This is the mail archive of the gcc-patches@gcc.gnu.org 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] Fix up make bootstrap-lean; make install (PR bootstrap/58572)


Hi!

As discussed in the PR, doing
make bootstrap-lean
make install
right now may fail (if host compiler is too old), or recompile various
objects of the compiler with system gcc before it is installed.
This happens because starting with the automatic dependency changes,
we have in gcc/.deps/*.Po lines like:
dfp.Po: /usr/src/gcc/obj942/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/gstdint.h \
alias.Po: /usr/src/gcc/obj942/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/cstring \
alias.Po: /usr/src/gcc/obj942/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/cstdlib \
(apparently just those 3 headers so far), but the prev-* directories are for
bootstrap-lean removed as soon as the new stage finishes (or after
comparison finishes), so they aren't available during make install.

As that is the whole point of the *-lean bootstraps to save disk space,
keeping the previous stage around is against the intent of that.
I've tried to manually just symlink
ln -sf x86_64-unknown-linux-gnu prev-x86_64-unknown-linux-gnu
but that apparently didn't help either.

So, this patch instead ensures we don't add the libstdc++-v3/ headers
into the *.Po files at all.  As the libstdc++ headers are all already
#pragma GCC system_header, this patch should make no change to
what warnings are emitted and will only affect the .deps/* files.

Bootstrapped/regtested on x86_64-linux and i686-linux and tested also
with make bootstrap-lean; make install, ok for trunk?

2014-03-06  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/58572
	* configure.ac (CXX_FOR_TARGET): Replace -I with -isystem
	in testsuite_flags --build-includes output.
	* Makefile.tpl (POSTSTAGE1_CXX_EXPORT): Use -isystem instead of
	-I for libstdc++-v3 includes.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

--- configure.ac.jj	2014-03-03 00:55:36.000000000 +0100
+++ configure.ac	2014-03-06 15:24:47.067298246 +0100
@@ -3208,7 +3208,7 @@ GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [
 GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
 dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
 GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
-		[gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
+		[gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes | sed "s/^-I/-isystem /;s/ -I/ -isystem /g"; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
 		c++)
 GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
 		[gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
--- Makefile.tpl.jj	2013-11-11 22:38:29.000000000 +0100
+++ Makefile.tpl	2014-03-06 15:49:02.290211483 +0100
@@ -242,9 +242,9 @@ POSTSTAGE1_CXX_EXPORT = \
 	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
 	  -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
 	  -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
-	  -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-	  -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-	  -I$$s/libstdc++-v3/libsupc++ \
+	  -isystem $$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
+	  -isystem $$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
+	  -isystem $$s/libstdc++-v3/libsupc++ \
 	  -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
 	  -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
 	  export CXX; \
--- configure.jj	2014-03-03 00:55:36.000000000 +0100
+++ configure	2014-03-06 15:28:41.094284292 +0100
@@ -13847,7 +13847,7 @@ else
   esac
   if test $ok = yes; then
     # An in-tree tool is available and we can use it
-    CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
+    CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes | sed "s/^-I/-isystem /;s/ -I/ -isystem /g"; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
 $as_echo "just compiled" >&6; }
   elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
--- Makefile.in.jj	2013-11-11 22:38:21.000000000 +0100
+++ Makefile.in	2014-03-06 15:49:23.144210239 +0100
@@ -239,9 +239,9 @@ POSTSTAGE1_CXX_EXPORT = \
 	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
 	  -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
 	  -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
-	  -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-	  -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-	  -I$$s/libstdc++-v3/libsupc++ \
+	  -isystem $$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
+	  -isystem $$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
+	  -isystem $$s/libstdc++-v3/libsupc++ \
 	  -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
 	  -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
 	  export CXX; \

	Jakub


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