ld_compile: force CFLAGS really necessary ?

Mike Frysinger vapier@gentoo.org
Wed Aug 29 04:15:00 GMT 2007


i fetched binutils-2.18 and ran it through some `make check` only to find ld 
oddly failling some tests on me ... after digging through it a bit, it seems 
it's due to mixing of CFLAGS and CXXFLAGS.

on my system, i throw -Wimplicit-function-declaration into my CFLAGS which 
does two things: (1) shows me implicit functions so i can send patches to fix 
code and (2) see when packages wrongly mix CFLAGS and CXXFLAGS.

in ld/testsuite/lib/ld-lib.exp, the ld_compile function will append $CFLAGS to 
all commands given it.  this means even tests like ld-cdtest which compiles 
C++ code and which will cause erroneous failures when CFLAGS contains things 
that are not valid in CXXFLAGS.  doing a quick grep against ld_compile, i see 
CFLAGS is explicitly specified in the call to ld_compile by over half the 
tests which use this function ... and on my system, simply removing the 
CFLAGS append inside of the ld_compile function doesnt cause any regressions.

so the question is, do we drop this auto CFLAGS append completely ?  or do we 
do a check against the suffix of $source and if it is set to .cc, auto append 
CXXFLAGS rather than CFLAGS ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20070829/7729926e/attachment.sig>


More information about the Binutils mailing list