Bugzilla – Bug 1866
waf treats CXXFLAGS differently during configure and build
Last modified: 2014-09-24 00:10:06 EDT
CXXFLAGS given at configure time are correctly added to compile commands: $ CXXFLAGS="-Wstrict-overflow=3" ./waf configure $ waf build -v [ 742/2050] cxx: src/stats/model/uinteger-8-probe.cc -> build/optimized/default/src/stats/model/uinteger-8-probe.cc.1.o 20:21:19 runner ['/usr/bin/g++', '-fstrict-overflow', '-Wstrict-overflow=4', '-fPIC', '-I.', '-I../../..', '-I/sw/include', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_MPI=1', '-DHAVE_SQLITE3=1', '-DHAVE_GSL=1', '../../../src/stats/model/uinteger-8-probe.cc', '-c', '-o', 'src/stats/model/uinteger-8-probe.cc.1.o'] Notice that the argument to the gcc argument is passed correctly: '-Wstrict-overflow=4' CXXFLAGS with arguments given at build time have the argument value omitted: $ waf build -v [ 742/2050] cxx: src/stats/model/uinteger-8-probe.cc -> build/optimized/default/src/stats/model/uinteger-8-probe.cc.1.o 20:21:19 runner ['/usr/bin/g++', '-fstrict-overflow', '-Wstrict-overflow', '-fPIC', '-I.', '-I../../..', '-I/sw/include', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_MPI=1', '-DHAVE_SQLITE3=1', '-DHAVE_GSL=1', '../../../src/stats/model/uinteger-8-probe.cc', '-c', '-o', 'src/stats/model/uinteger-8-probe.cc.1.o'] Notice that the argument is missing: '-Wstrict-overflow'
(In reply to Peter Barnes from comment #0) > CXXFLAGS given at configure time are correctly added to compile commands: > > $ CXXFLAGS="-Wstrict-overflow=3" ./waf configure > $ waf build -v > [ 742/2050] cxx: src/stats/model/uinteger-8-probe.cc -> > build/optimized/default/src/stats/model/uinteger-8-probe.cc.1.o > 20:21:19 runner ['/usr/bin/g++', '-fstrict-overflow', '-Wstrict-overflow=4', > '-fPIC', '-I.', '-I../../..', '-I/sw/include', '-DHAVE_SYS_IOCTL_H=1', > '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_MPI=1', '-DHAVE_SQLITE3=1', > '-DHAVE_GSL=1', '../../../src/stats/model/uinteger-8-probe.cc', '-c', '-o', > 'src/stats/model/uinteger-8-probe.cc.1.o'] > > Notice that the argument to the gcc argument is passed correctly: > '-Wstrict-overflow=4' > > CXXFLAGS with arguments given at build time have the argument value omitted: > > $ waf build -v > [ 742/2050] cxx: src/stats/model/uinteger-8-probe.cc -> > build/optimized/default/src/stats/model/uinteger-8-probe.cc.1.o > 20:21:19 runner ['/usr/bin/g++', '-fstrict-overflow', '-Wstrict-overflow', > '-fPIC', '-I.', '-I../../..', '-I/sw/include', '-DHAVE_SYS_IOCTL_H=1', > '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_MPI=1', '-DHAVE_SQLITE3=1', > '-DHAVE_GSL=1', '../../../src/stats/model/uinteger-8-probe.cc', '-c', '-o', > 'src/stats/model/uinteger-8-probe.cc.1.o'] > > Notice that the argument is missing: '-Wstrict-overflow' In the example above, were you passing anything in CXXFLAGS in the second case, to try to override it? How was your second case configured? I believe that waf uses the CXXFLAGS registered at configure time and stored in the build/c4che/_cache.py when it is time to build, and that users cannot override it by passing a new CXXFLAGS at build time. I think this is just how waf works (configure governs the build).
Suggest that waf should complain at build time if it receives options only valid at configure time.