*FLAGS_FOR_BUILD vs cross-compiling

Mike Frysinger vapier@gentoo.org
Sun Oct 7 04:25:00 GMT 2007


the toplevel configure.ac currently does:
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CFLAGS}}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${CFLAGS}}

there's two things wrong here ... first, the default for CXXFLAGS/LDFLAGS 
should be CXXFLAGS/LDFLAGS, not CFLAGS.  the other is that FOR_BUILD 
variables should not default to the host flags if $host != $build.  the 
program FOR_BUILD variables (like AR/RANLIB/etc...) already test this, but 
the *FLAGS do not.  so if you try to build like:
CFLAGS="-m4" ./configure --build=x86_64-... --host=sh4-... --target=sh4-...
it'll fail if any build binaries need to be compiled (like the "chew" binary 
in bfd/doc/).

the attached patch should rectify both of these issues.
-mike

2007-10-06  Mike Frysinger  <vapier@gentoo.org>

	* configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD,
	LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build.
	Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS.  Set default
	LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS.
	* configure: Regenerate.
-------------- 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/20071007/dec76a6c/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-for-build.patch
Type: text/x-diff
Size: 1008 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071007/dec76a6c/attachment.bin>


More information about the Binutils mailing list