patches/gcc/4.4.2/370-bootstrap-target_lib_path.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:51:25 2010 +0200 (2010-09-12)
changeset 2123 ff2181adbd28
permissions -rw-r--r--
cc/gcc: disable complibs if not selected

Force gcc to not link with some companion libraries when
there are not needed (because selected-out).

There is no option to tell gcc *not* to build the Graphite and/or
LTO stuff. They *will* be built if gcc finds the suitable companion
libraries. If we do not provide them, but the host has them, then
gcc *will* find them, and link with them.

Consider the following:
- host has suitable PPL and CLooG (eg. Debian Squeeze)
- user wants to build gcc>=4.4
- user de-selects GRAPHITE
- gcc will find the hosts PPL and CLooG, and will use them
- the user moves the toolchain to an older host that does
not have them (eg. Debian Lenny)
- the toolchain fails, when it was properly setup not to

So, explicitly tell gcc *not* to use unneeded companion libs.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1698
     1
ChangeLog:
yann@1698
     2
2010-01-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
yann@1698
     3
yann@1698
     4
	PR bootstrap/41818
yann@1698
     5
	* Makefile.tpl (BASE_TARGET_EXPORTS): Only add TARGET_LIB_PATH
yann@1698
     6
	to $(RPATH_ENVVAR) if bootstrapping.
yann@1698
     7
	* Makefile.in: Regenerate.
yann@1698
     8
yann@1698
     9
diff --git a/Makefile.in b/Makefile.in
yann@1698
    10
index e5fa1d3..dbfc1f0 100644
yann@1698
    11
--- a/Makefile.in
yann@1698
    12
+++ b/Makefile.in
yann@1698
    13
@@ -281,7 +281,10 @@ BASE_TARGET_EXPORTS = \
yann@1698
    14
 	STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
yann@1698
    15
 	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
yann@1698
    16
 	WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
yann@1698
    17
-	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
yann@1698
    18
+@if gcc-bootstrap
yann@1698
    19
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
yann@1698
    20
+@endif gcc-bootstrap
yann@1698
    21
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
yann@1698
    22
 
yann@1698
    23
 RAW_CXX_TARGET_EXPORTS = \
yann@1698
    24
 	$(BASE_TARGET_EXPORTS) \
yann@1698
    25
diff --git a/Makefile.tpl b/Makefile.tpl
yann@1698
    26
index 15102e5..452d47c 100644
yann@1698
    27
--- a/Makefile.tpl
yann@1698
    28
+++ b/Makefile.tpl
yann@1698
    29
@@ -284,7 +284,10 @@ BASE_TARGET_EXPORTS = \
yann@1698
    30
 	STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
yann@1698
    31
 	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
yann@1698
    32
 	WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
yann@1698
    33
-	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
yann@1698
    34
+@if gcc-bootstrap
yann@1698
    35
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
yann@1698
    36
+@endif gcc-bootstrap
yann@1698
    37
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
yann@1698
    38
 
yann@1698
    39
 RAW_CXX_TARGET_EXPORTS = \
yann@1698
    40
 	$(BASE_TARGET_EXPORTS) \