Task #2404
closed
Incorrect compiler defaults on FreeBSD platform
Added by Alex Afanasyev almost 10 years ago.
Updated almost 10 years ago.
Description
Our waf is not using correct compiler defaults on FreeBSD 10.1. It first checks for g++, which is actually symlinked to clang. When in our scripts we check versions, waf still thinks it uses gcc compiler and we incorrectly fail the compilation with the error that the compiler is too old.
The current workaround is to explicitly tell waf to detect clang compiler:
./waf configure --check-cxx-compiler=clang++
There are two ways how things can get improved:
We should set correct defaults for FreeBSD platform (e.g., compiler check order should be: clang++, g++)
We can make compiler version check an advisory. In other words, instead of failing the compilation, we can just warn that we expect the compilation to fail.
- Related to Task #2168: Jenkins: FreeBSD 10.1 slave added
- Status changed from New to Code review
- % Done changed from 0 to 100
Sounds like an upstream waf bug... it should not be relying on the executable name, instead it should parse the output of ${compiler} --version
or something like that.
- Description updated (diff)
- Description updated (diff)
It is not relying on the name. Inside waf, it has a number of "tools" for compiler detection and it tries them in specific order (there is a default one and can be overridden by --check-cxx-compiler=clang++
option. The specific compiler detection tool sets CXX_NAME
variable (common name for the compiler), which we use to do other funky business in default-compiler-flags
.
I would say it is correct behavior, as it is close to impossible to guess the compiler type and name neither based on file name nor version output. Waf is trying hard to properly guess version, but it is still kind of compiler-specific.
- Description updated (diff)
- Description updated (diff)
In any case. I have already submitted a bug report with suggested path to waf issue tracker (the version in http://gerrit.named-data.net/#/c/1662/ is master branch plus few extra things, including the fix for this issue).
Alex Afanasyev wrote:
It is not relying on the name. Inside waf, it has a number of "tools" for compiler detection and it tries them in specific order (there is a default one and can be overridden by --check-cxx-compiler=clang++
option. The specific compiler detection tool sets CXX_NAME
variable (common name for the compiler), which we use to do other funky business in default-compiler-flags
.
Well, whatever the "gcc detection tool" is relying on is broken then. It's still a waf bug. I don't think we're doing anything particularly funky.
I would say it is correct behavior, as it is close to impossible to guess the compiler type and name neither based on file name nor version output. Waf is trying hard to properly guess version, but it is still kind of compiler-specific.
I find it hard to agree. First, by definition it cannot be correct behavior, since it's mis-detecting the compiler. Second, I've never had this kind of problem with other (more mature I guess) build systems. Anyway, this is beside the point. If change 1662 works I'm fine with it.
- Status changed from Code review to Closed
Also available in: Atom
PDF