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]

Re: [vta] revamp bootstrap-debug with -fcompare-debug, fix LIBCFLAGS uses

Alexandre Oliva <> writes:
> Second, I found that LIBCFLAGS was not used consistently.  IMHO, we
> should only use LIBCFLAGS for builds using the pre-installed host
> compiler.  For target builds, we should use LIBCFLAGS_FOR_TARGET, and
> for host builds in in stage2+ I can see that it makes sense to use
> either STAGE_CFLAGS (being the preferred flags for GCC for that stage,
> without any of the magic flags required by the compiler used to build
> stage1) or CFLAGS_FOR_TARGET (being the preferred flags for the GCC
> built in the previous stage).  I chose the former, for simplicity.

This is PR/37137.  Can this part of the fix be merged to trunk now?

I think you also need to update install.texi.  See my WIP patch for the same


Index: Makefile.tpl
--- Makefile.tpl	(revision 140955)
+++ Makefile.tpl	(working copy)
@@ -370,7 +370,11 @@ STAGE2_CFLAGS=$(BOOT_CFLAGS)
+# Used during stage1 with host libraries.
+# Used during stage1 with target libraries.
@@ -945,9 +949,14 @@ all-stage[+id+]-[+prefix+][+module+]: co
 	cd [+subdir+]/[+module+] && \
 		CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \
-		LIBCFLAGS="[+stage_libcflags+]" \
+		LIBCFLAGS="[+stage_libcflags+]"[+
+		IF (= (get "id") "1") +] \
+		ELSE +] \
 		CFLAGS_FOR_TARGET="[+stage_libcflags+]" \
-		CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+
+		CXXFLAGS_FOR_TARGET="[+stage_libcflags+]"[+
+		ENDIF +] [+args+] [+
 		IF prev +][+poststage1_args+][+ ENDIF prev
 		+] [+extra_make_flags+] \
Index: gcc/doc/install.texi
--- gcc/doc/install.texi	(revision 140955)
+++ gcc/doc/install.texi	(working copy)
@@ -1848,7 +1848,7 @@ bootstrapped, you can use @code{CFLAGS_F
 compilation flags, as for non-bootstrapped target libraries.
 Again, if the native compiler miscompiles the stage1 compiler, you may
 need to work around this by avoiding non-working parts of the stage1
-compiler.  Use @code{STAGE1_LIBCFLAGS} to this end.
+compiler.  Use @code{STAGE1_CFLAGS_FOR_TARGET} to this end.
 If you used the flag @option{--enable-languages=@dots{}} to restrict
 the compilers to be built, only those you've actually enabled will be

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