This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/36781] New: gcc can't be compiled in an environment that requires CFLAGS
- From: "mikulas at artax dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2008 02:40:07 -0000
- Subject: [Bug other/36781] New: gcc can't be compiled in an environment that requires CFLAGS
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If you have an environment where special CFLAGS are needed for compilation, gcc
doesn't compile (in my example, it was Sparc that requires -m64). The
configure/make scripts are so messed up that they will eventually drop CFLAGS
and try to compile parts of gcc without them.
How to reproduce on any system:
move file /usr/bin/gcc to /usr/bin/gcc.x. Create new /usr/bin/gcc containing
this script:
#!/bin/sh
if [ -z "`echo "$@"|grep -- -fomit-frame-pointer`" ]; then
echo GCC WAS EXECUTED WITHOUT CFLAGS
exit 1
fi
gcc.x "$@"
Unpack gcc, set CFLAGS, CPPFLAGS and LDFLAGS to -fomit-frame-pointer and try to
compile. gcc attempts to compile libiberty without -fomit-frame-pointer and
fails.
I tried to set the variables before configure, to set the variables on make
command line, tried also setting LIBCFLAGS and BOOT_CFLAGS, but none helps.
The build scripts should be fixed to not lose CFLAGS and proper method for
setting the flags (before ./configure, like most packages? or make
CFLAGS=flags?) should be documented. The build stdout should be grepped for
lines containing the compiler and not containing CFLAGS to check that CFLAGS
are not lost in any part of compilation.
--
Summary: gcc can't be compiled in an environment that requires
CFLAGS
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz
GCC build triplet: sparc64-unknown-linux-gnu
GCC host triplet: sparc64-unknown-linux-gnu
GCC target triplet: sparc64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36781