public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH RFA] build: drop target libs from LD_LIBRARY_PATH [PR105688]
@ 2024-02-07  1:54 Jason Merrill
  2024-02-07 20:36 ` Ian Lance Taylor
  2024-02-08  5:36 ` Alexandre Oliva
  0 siblings, 2 replies; 31+ messages in thread
From: Jason Merrill @ 2024-02-07  1:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alexandre Oliva, Paolo Bonzini, Ian Lance Taylor

Tested x86_64-pc-linux-gnu.  Any thoughts?

-- 8< --

The patch for PR22340 (r104978) moved the adding of TARGET_LIB_PATH to
RPATH_ENVVAR from POSTSTAGE1_HOST_EXPORTS to HOST_EXPORTS, but didn't
mention that in the ChangeLog; it also wasn't part of the patch that was
sent to gcc-patches.  I suspect it was included accidentally?

It also causes PR105688 when rebuilding stage1: once the stage1 libstdc++
has been built, if calling the system gcc to build host code involves
invoking any tool that links against libstdc++.so (gold, ccache) they get
the just-built library instead of the system library they expect.

Reverting that hunk of the change fixed my problem with bubblestrapping GCC
12 with ccache on a host with a newer system libstdc++.

But I believe that adding TARGET_LIB_PATH to RPATH_ENVVAR is not needed for
post-stage1 either, at this point.  Including TARGET_LIB_PATH goes back to
r37545, with the stated rationale of getting other C++ library configury to
succeed, but it looks to me like that is no longer necessary.

So I propose to stop adding target libraries to LD_LIBRARY_PATH; see
https://gcc.gnu.org/legacy-ml/gcc/2012-06/msg00325.html for a previous
proposal by Ian to make this change.

I have tried and failed to test this on a system without system libstdc++;
bootstrap on cfarm220 and cfarm240 failed for unrelated reasons.

	PR bootstrap/105688

ChangeLog:

	* Makefile.tpl (HOST_EXPORTS): Don't add TARGET_LIB_PATH to
	RPATH_ENVVAR.
	* Makefile.in: Regenerate.
---
 Makefile.in  | 3 ---
 Makefile.tpl | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index edb0c8a9a42..c2843d5df89 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -242,9 +242,6 @@ HOST_EXPORTS = \
 	ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
 	ISLINC="$(HOST_ISLINC)"; export ISLINC; \
 	XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
-@if gcc-bootstrap
-	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
-@endif gcc-bootstrap
 	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 POSTSTAGE1_CXX_EXPORT = \
diff --git a/Makefile.tpl b/Makefile.tpl
index adbcbdd1d57..cb39fbd0434 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -245,9 +245,6 @@ HOST_EXPORTS = \
 	ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
 	ISLINC="$(HOST_ISLINC)"; export ISLINC; \
 	XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
-@if gcc-bootstrap
-	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
-@endif gcc-bootstrap
 	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 POSTSTAGE1_CXX_EXPORT = \

base-commit: c5d34912ad576be1ef19be92f7eabde54b9089eb
-- 
2.43.0


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2024-02-24 12:19 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07  1:54 [PATCH RFA] build: drop target libs from LD_LIBRARY_PATH [PR105688] Jason Merrill
2024-02-07 20:36 ` Ian Lance Taylor
2024-02-08  5:36 ` Alexandre Oliva
2024-02-08 15:04   ` Iain Sandoe
2024-02-08 17:12     ` Jason Merrill
2024-02-08 17:16       ` Jason Merrill
2024-02-08 17:51         ` Iain Sandoe
2024-02-08 19:25           ` Jason Merrill
2024-02-08 19:52             ` Iain Sandoe
2024-02-22 18:06               ` Gaius Mulley
2024-02-22 20:30                 ` Iain Sandoe
2024-02-24 10:23                   ` Gaius Mulley
2024-02-08 17:55         ` Paolo Bonzini
2024-02-08 21:44           ` Jason Merrill
2024-02-09 10:56             ` Iain Sandoe
2024-02-09 23:21               ` Iain Sandoe
2024-02-10 10:46                 ` Iain Sandoe
2024-02-10 12:07                   ` Jason Merrill
2024-02-10 12:30                     ` Iain Sandoe
2024-02-12 19:59                       ` Jason Merrill
2024-02-14 22:59                         ` Iain Sandoe
2024-02-14 23:33                           ` Iain Sandoe
2024-02-16 21:05                             ` Jason Merrill
2024-02-19 20:08                               ` Iain Sandoe
2024-02-20  5:45                               ` Alexandre Oliva
2024-02-21 23:06                                 ` Jason Merrill
2024-02-21 23:36                                   ` Iain Sandoe
2024-02-23  9:09                                     ` Iain Sandoe
2024-02-23 11:23                                   ` Alexandre Oliva
2024-02-23 19:07                                     ` Jason Merrill
2024-02-24 12:19                                       ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).