From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by sourceware.org (Postfix) with ESMTPS id BED663858C5F for ; Wed, 7 Feb 2024 20:36:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BED663858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=golang.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=golang.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BED663858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1132 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707338194; cv=none; b=iNXUK2N4qUWWlXHX+kbISoGzQPqNqy8VUn33Ai+jnKuL6M4oUnFW2wI9rNciquvZpX3h+JicMFELuJOsiszDe5JmZlVfOPG6dYGZj986S1F/vBpkIRjdELRtzxR940j5YotL8ShyzBqXejariXO7jCgQtYhp+kEK+zrr8LckG4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707338194; c=relaxed/simple; bh=IzmuzKNIO8eCC9NLqHVSfd/LlOyXPIDiQPMO/wxfOb4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=oWACjoDN14+85WKZx6iOQRo4hopxI08fwsn3UqUJA6op0b6pmHcdDQDDTa0Ryup7oIWznW4dLfnWW1p7li3UbSIPo98VPKI0X/InaCsNLJL4XWVSm3YEk5ABzM9wMUra5ib6vsCSNEHhVk+xnI+ZvIhOUq3ZQz5tUIwX48ooF0Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-60486805aa8so12708317b3.0 for ; Wed, 07 Feb 2024 12:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golang-org.20230601.gappssmtp.com; s=20230601; t=1707338191; x=1707942991; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oQ7FggM8QfsVbvG5cztTUm/cRLqC+rGbL76SapJRWLg=; b=FkCpdgheMe7Xw+JKGnIXxGqLJoWo8cRbAecRZOOAGkQlydDMR1KFb4DAFpwbpENFtK bDw86PFGpRIOXi8LDKNjlXdXTnKkgx7pyh3rx6WJs0Z2U4UzxxS7bi3f2eJ8sYa+hjyG KuLq0NOSbiz5RN90MKk9w1N+U6njq4XY+NSEwcyrWu6OtyIs/wiEopFlumSzkDz64G/s icP8S9Q+wZjL8sbb0qr7zCOQJXbwjZUQuggxuSbnEEPu/Y8V06rooeuyxBpG3QdIyPyE HNtxdTb9b+d5P50xgbXg2y9xDWQzM/SaXNnRBZDogMbNYcTiYKduGzP32WfVSxFJgmWk 29Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707338191; x=1707942991; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oQ7FggM8QfsVbvG5cztTUm/cRLqC+rGbL76SapJRWLg=; b=vHFgdDdR8KXzIVh5VCSjBSlyVrFx6yVw8ngE1fu5mWh63A/mtbWKNWrmvhi7Kmgg4+ lAXZjjI1hmxZNVcFvNpqNg3MLkVVvdyMQAMzfcdKdP5J9d4IsEdk3YfXAHpaa9il+7TA 833pwdJw5LkmRYsb0RmZwMRH3Wvfbr/3yFjCtddqxaOqB8pwXELnYkZznHBbhG+MkfbU zpQ9X2FMKt3LD9o1iUKUIG/FyZZ4ynTWYebnDZQWGvq9XzJ4VfHjGHqff6+dLGq/yTvi tFYkhw5gDBO/IReVN0vd3zH/G33DmZCv4BYgdlBIyZHK/KbnY+cy23HpDqt1tqqBdoLc dssw== X-Gm-Message-State: AOJu0YzjyC7A5DgIabyZfXi19Q37ysHGyFjVesLfNK2OOqHaHlGryfBu DFbbbry5TgC5JIe2iwIIxlt6azRA29l6dRkGEhQnvO8vvAb3MLFRY5rh8I/8rsGEe7CnIQ9/fR4 mHnhf4FEAljyit9dxiHwnRzdpjZdI0VhN3qWl1Q== X-Google-Smtp-Source: AGHT+IGXT8kA89mQoEFdx5IcK85L1+EkT5nuaTiuvYmHpdSoaH3k3kZXEzRh9kpVh4t77IXhkK9TEFXVzXWpy7XHWMU= X-Received: by 2002:a81:92d4:0:b0:604:a0e0:5863 with SMTP id j203-20020a8192d4000000b00604a0e05863mr896185ywg.21.1707338191002; Wed, 07 Feb 2024 12:36:31 -0800 (PST) MIME-Version: 1.0 References: <20240207020839.96099-1-jason@redhat.com> In-Reply-To: <20240207020839.96099-1-jason@redhat.com> From: Ian Lance Taylor Date: Wed, 7 Feb 2024 12:36:19 -0800 Message-ID: Subject: Re: [PATCH RFA] build: drop target libs from LD_LIBRARY_PATH [PR105688] To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, Alexandre Oliva , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Feb 6, 2024 at 6:08=E2=80=AFPM Jason Merrill wro= te: > > Tested x86_64-pc-linux-gnu. Any thoughts? It still makes sense to me, for what that's worth. Ian > -- 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 G= CC > 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 f= or > post-stage1 either, at this point. Including TARGET_LIB_PATH goes back t= o > 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 =3D \ > ISLLIBS=3D"$(HOST_ISLLIBS)"; export ISLLIBS; \ > ISLINC=3D"$(HOST_ISLINC)"; export ISLINC; \ > XGCC_FLAGS_FOR_TARGET=3D"$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_F= LAGS_FOR_TARGET; \ > -@if gcc-bootstrap > - $(RPATH_ENVVAR)=3D`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | s= ed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ > -@endif gcc-bootstrap > $(RPATH_ENVVAR)=3D`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed= 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); > > POSTSTAGE1_CXX_EXPORT =3D \ > diff --git a/Makefile.tpl b/Makefile.tpl > index adbcbdd1d57..cb39fbd0434 100644 > --- a/Makefile.tpl > +++ b/Makefile.tpl > @@ -245,9 +245,6 @@ HOST_EXPORTS =3D \ > ISLLIBS=3D"$(HOST_ISLLIBS)"; export ISLLIBS; \ > ISLINC=3D"$(HOST_ISLINC)"; export ISLINC; \ > XGCC_FLAGS_FOR_TARGET=3D"$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_F= LAGS_FOR_TARGET; \ > -@if gcc-bootstrap > - $(RPATH_ENVVAR)=3D`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | s= ed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ > -@endif gcc-bootstrap > $(RPATH_ENVVAR)=3D`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed= 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); > > POSTSTAGE1_CXX_EXPORT =3D \ > > base-commit: c5d34912ad576be1ef19be92f7eabde54b9089eb > -- > 2.43.0 >