From patchwork Wed Feb 7 01:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 197700 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1948614dyb; Tue, 6 Feb 2024 18:09:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQNVOZjKtNfW/sy3J3CCKBGlnLUDbMHUyAc/qdVwSIq7JEdr/SWKQqVg8aaC0zKLXyEeZQQWRf6V3k6uAy6k5MF/x2bQ== X-Google-Smtp-Source: AGHT+IEAVwTChEFivdbXJ/WH9od0BPg4BrHdsa8b+AdcFl58dW8YBW5o7lPuuGDbuzAQ37Xe4756 X-Received: by 2002:a05:620a:4e2:b0:785:4e16:4f25 with SMTP id b2-20020a05620a04e200b007854e164f25mr4189615qkh.51.1707271781135; Tue, 06 Feb 2024 18:09:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707271781; cv=pass; d=google.com; s=arc-20160816; b=g48c9YLeB0CUGDDpHWbz11Ve8XdKgUZESRD9Be+co26vRq72rxKZ7NCgOycCD0Fncz ggwFt1aYPL88R3xfTIZW5glnZO5c67NEFvNJPW0ilAguVgaqW/x+7Nkz8bgA+izoMPh+ sHvH1PL/6mNZAAVhpVt8PFCQobmOfQ60g9pXuvR+/8VHxlI4+hZsdc7iwSwiInWcoSvP LfT8mTe75/x3l8kgKkM3znDWg2emGV+fd3BX4jDcK/mp8qEmn72PutCZsNv1ouq0spAK WonZBcOZL8Fo1FelXYYZuhvwoCjiAV3dj8CFp2caVu1B8USOr92wkXJTMZ2xlQ84EYlG Gd4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=6joPNXUI4t1c7Ee+8KasCqlfb+b9iYVBhMunr7wBBqE=; fh=pwbdVikrbzJ/PHtmUpBCSg0KRKrY0Qu10womzLlC3yY=; b=Y4e5X9LKmmaguvrgPjrWPRsWDoE5c34oam307632O1hhyPkEZj8fb0+fYR3HAHPZic eXqyzbbuUc+IjtkDgFqud4j7f1IBtwdJQayT4P0bOF6ubhevLMqiD4CsrJUV6V+BGLf0 Y7lh8nYiRsU5ATG5xCeEfGBP285gTvSuPG0q+9fvZ8GRJU5c5bizcqw0HnvC0vdY1+3a KDF5XThHL+wEmRoWLHIfTSOsOOQIlawGnd7FHynKWdEoGVDgALlU1GGIWx7lbiU1Scvf VOQp1xhmX6whEnW1uhqfDq+4851wK2gYB+8LthkZVUHBY3ZongGCPEUd8W0UXv2ycOvQ LV0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KD197yG5; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCWEXrhy1CIU0+7KXdGJnycL8E4ccckFBR+mDXNk5m7u95RnkPwA05ZKyluggKNqbjDBCho7QwIdkO97JjryZFw/jiCSHA== Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h2-20020a05620a400200b007853f73688fsi259041qko.40.2024.02.06.18.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:09:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KD197yG5; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D39AD385842D for ; Wed, 7 Feb 2024 02:09:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D93A13858D33 for ; Wed, 7 Feb 2024 02:08:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D93A13858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D93A13858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707271730; cv=none; b=vN8GuG+7LZyzJ+TyEWciKuhJsN0x1o+Apk8W654nFgi8loHz2ThBNgTJJvSwZ/fTNOY9/Oy/YdSmG+3DYMOVrBCrU67lV9F2mnYuzIA/ZfJEQjQOet2ef0H20MvvIf7NKkPj3X6MmoDmxtxCcqCx23/YWJvWnDbps82ajki67Hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707271730; c=relaxed/simple; bh=splbiLeB8AL1S+J7uKdXntDcKq1lQ4vX5jS0mK4XuaE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tmm+JNrmkqM128EZVdLv76DmphLguE8kfXxDs0OKELNx7+WScXATqvvl8SnjJvNwcMLqOs4Gcto4jRl0k92czVJ7rcMWPSedq9anR6vtdlT9LaTi67g3bx8bxwsSOAmQ+r5AqjrjsJRoCXEUsRgTeyAQnIWleoHOy0q8cs0reVw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707271724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6joPNXUI4t1c7Ee+8KasCqlfb+b9iYVBhMunr7wBBqE=; b=KD197yG5uuQf+iMu9xxi72lkxogI/x0tzBp43PMyptFMFP+Y0Qh5zezyxm7zlj0K6Ko/5b nCNDC1fsuMtBugvCfGkpSTs8g8mQqD1+eqevBfcgkbzNYSsjaaP3tUW2nZu7bNKVR5i1lg HUT1z6+HBY/F2lXefon3gedQrvG3Th8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-649-N5icQN_NMQyPQddOjTWCiA-1; Tue, 06 Feb 2024 21:08:42 -0500 X-MC-Unique: N5icQN_NMQyPQddOjTWCiA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-68c4f4dea85so2959346d6.1 for ; Tue, 06 Feb 2024 18:08:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707271721; x=1707876521; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6joPNXUI4t1c7Ee+8KasCqlfb+b9iYVBhMunr7wBBqE=; b=fjy0/Etl02r38E2gsz9cjR2Dj2yn5oMBWNjQo9yFXET0S8n27hajgFugFrwHIg01QR N3+6yp3eqgH0ULXHx8JFhvvPCxn5oUVrslRiAbcIEfJVsoaSUgFZgR2t5RiGa/d2SU6N J1ULFTPR3JmQlSHIW6ak6Z8p9OLehCJEEw05aqdPZBlXP+20OA6kEhrlPYNmuc76Vl1W eN0WxIuAxLHQPA5IaZuCrD6rfzxzRqu+N93BASL9LAKj7FmjZs1gHGjhAaTudGGwVB65 pxGWc78YVwIZGJh5/3uDZUQ2X3DAbrDvuAz0Dnhm8w8fN9A5MQStuR/mAy1fx1TbLyfD H5mg== X-Gm-Message-State: AOJu0Yxf/UrbYUU7GJu1X+z2z0qUp3npc/hgrJtp+oyCeiTxQYDx0jLs EU8u1Ylg6kx98dr4X3UKQHQOYkrXK6NRaFVgdhG8o4TrC+7k2SpG9aNs0UGoBedNfjaxdpH/YvT StQWJq4lC8MMGzXQ6g94fcx93aVnYx3KLUgFnm+wrzr+Ai7pecscYSgtOzhsQ4tKYQZuGll34pW TQBlnuyG4gsIZavqdsQQNNBzRKmI4KLg5oWrM= X-Received: by 2002:a05:6214:1d24:b0:68c:4f1c:d33b with SMTP id f4-20020a0562141d2400b0068c4f1cd33bmr5254144qvd.37.1707271721472; Tue, 06 Feb 2024 18:08:41 -0800 (PST) X-Received: by 2002:a05:6214:1d24:b0:68c:4f1c:d33b with SMTP id f4-20020a0562141d2400b0068c4f1cd33bmr5254126qvd.37.1707271721129; Tue, 06 Feb 2024 18:08:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXUj2ma9Jra+nQcySNnPiz7AGnK1W1efYHyXVA9w5vUScNFzK29rB6+rcID11w0tyW7i7uo//RVmZymg/+Qp8CZOHN85qHYaZTY7WQWyOu9RQ== Received: from jason-thinkpadp1gen4i.rmtusma.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id qq15-20020a0562142c0f00b00685191beaa9sm112573qvb.3.2024.02.06.18.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:08:40 -0800 (PST) From: Jason Merrill To: gcc-patches@gcc.gnu.org Cc: Alexandre Oliva , Paolo Bonzini , Ian Lance Taylor Subject: [PATCH RFA] build: drop target libs from LD_LIBRARY_PATH [PR105688] Date: Tue, 6 Feb 2024 20:54:54 -0500 Message-ID: <20240207020839.96099-1-jason@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790204215072554204 X-GMAIL-MSGID: 1790204215072554204 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(-) base-commit: c5d34912ad576be1ef19be92f7eabde54b9089eb 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 = \