This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for Review: Allow Explicit CFLAGS_FOR_BUILD

Hi People,

This patch is the result of this issue:

Here is the relevant text from this post:

Building with -f-no-unit-at-a-time was problematic for my cross
build because the (i686-pc-linux-gnu,i686-pc-mingw32,i686-pc-mingw32)
build uses i686-pc-linux-gnu-gcc to build libiberty for the
build machine. I have gcc 3.2 on my Linux box, which
doesn't understand -f-no-unit-at-a-time, so the build choked.
I worked around this by commenting out this line in the
top-level gcc


...and explicitly declaring a CFLAGS_FOR_BUILD in the shell
script which run configure which didn't have -f-no-unit-at-a-time:

export CFLAGS_FOR_BUILD="-O2 -g0 -pipe"
export CFLAGS="$CFLAGS_FOR_BUILD -fno-unit-at-a-time"

It seems to be a weakness in the configure process that for
a crossed-native build (build!=host, host=target), that CFLAGS_FOR_BUILD
(for libiberty) is doomed to be the same as the CFLAGS passed to
the cross compiler. Should I follow up on this?

This patch allows the explicit specification of CFLAGS_FOR_BUILD
to work around the issue where the flags to the build machine
compiler may not necessarily be the same as the flags to whatever
cross compiler is building the real compiler and its libraries.

What do you think? Please CC me personally as I am not subscribed
to gcc-patches.

-- Mohan

2003-10-05  Mohan Embar  <>

	* Allow explicit specification of CFLAGS_FOR_BUILD.
	* configure: Rebuilt
	* Makefile.tpl: Use CFLAGS_FOR_BUILD computed by configure
	* Rebuilt

RCS file: /cvs/gcc/gcc/,v
retrieving revision 1.258
diff -u -2 -r1.258
---	21 Sep 2003 19:32:22 -0000	1.258
+++	5 Oct 2003 13:24:31 -0000
@@ -1920,4 +1920,8 @@
+# Allow the user to override the flags for
+# our build compiler if desired.
 # On Canadian crosses, we'll be searching the right directories for
 # the previously-installed cross compiler, so don't bother to add
@@ -2061,4 +2065,5 @@
Index: Makefile.tpl
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.72
diff -u -2 -r1.72 Makefile.tpl
--- Makefile.tpl	20 Sep 2003 21:16:09 -0000	1.72
+++ Makefile.tpl	5 Oct 2003 13:24:19 -0000
@@ -146,5 +146,5 @@
 # environment.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]