-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Configure: use a better method to identify gcc and derivates [1.0.2] #4755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure: use a better method to identify gcc and derivates [1.0.2] #4755
Conversation
Configure
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that on (new) line 1679, there already is an exact string comparison for clang...
Configure
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On side note this can't actually happen, there is no such thing as icc cross-compiler. But for consistent view...
Configure
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On side note it was pointed out that gcc compiler driver reports basename of argv[0] in --version output. How is it a problem? Customarily you'd have /usr/bin/cc that is gcc in disguise, but this check won't recognize it as gcc as it will report cc 3.2.1. Also note that archaic gcc versions print just version number, e.g. 2.25.3, i.e. don't identify themselves the expected way. None of this applies to clang, so that check for presence of "clang" in --version output is reliable. Unlike gcc that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be noted however that as far as MAKEDEPPROG goes that thing that archaic gcc versions print just version number incidentally works out. This is because archaic versions don't support generation of dependencies, and you don't "want" to recognize it as gcc :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another problem with check for gcc in --version output is ... IBM compiler. When it doesn't recognize command line option, such as --version here, it emits manual page, which mentions gcc, so that the check should does come out successful...
EDIT: "should" -> "does"
Looking for 'gcc' and 'clang' in the output from the C compiler is uncertain. Some versions report argv[0], which might be /usr/bin/cc (for example), and others might mention gcc without being gcc or a derivate. Better then to fetch predefined macros and checking if __GNUC__ and __clang__ are defined.
2a2c026 to
86b02cf
Compare
|
I remade this entirely, using the same check of predefined macros as in master. |
|
What is the status of this? |
Looking for 'gcc' and 'clang' in the output from the C compiler is uncertain. Some versions report argv[0], which might be /usr/bin/cc (for example), and others might mention gcc without being gcc or a derivate. Better then to fetch predefined macros and checking if __GNUC__ and __clang__ are defined. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from #4755)
|
Merged. 78e9e3f |
|
This commit appears to break Mac OS X 10.7 (when cross-compiling for iOS or 10.5).
|
|
Ah, it should probably become this in that case: |
|
Let us try it and see if it works... |
|
This is not true cross-compiling, so The Which doesn't contain "clang", thus Mac OS X 10.11 does't experience this problem; it's with older versions of Mac OS X. |
|
That basically tells me that cc on 10.7 falsely declares itself compatible with some newer gcc version... |
|
At the very least, it's that |
|
That just sucks. In either case, if so desired, it would be appropriate to check even for |
|
The 10.8 compiler It does not define |
It seems that I've expressed myself a bit unfortunate. It should have been "reliable enough" instead of "accurate enough". I mean reliability over accuracy in sense that it would be safer to misinterpret conditions in favour of makedepend than vice versa. In other words even if specific compiler version is capable of handling dependencies, we don't have to "feel bad" about ending up with makedepend. As long as makedepend works that is. It all boils down to question whether or not you can confirm that first version of Apple compiler that defines |
|
Actually, it appears that if the Apple compiler defines |
You probably meant that |
|
Right, unfortunately, I don't have a proper sample of compilers. |
|
This also broke our mingw environment. |
Looking for 'gcc' and 'clang' in the output from the C compiler is
uncertain. Some versions report argv[0], which might be /usr/bin/cc
(for example), and others might mention gcc without being gcc or a
derivate.
Better then to fetch predefined macros and checking if
__GNUC__and__clang__are defined.This is an alternative to #1524