From patchwork Wed Jan 22 16:12:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andreas K. Huettel" X-Patchwork-Id: 105250 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 85B6B385772F for ; Wed, 22 Jan 2025 16:14:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85B6B385772F X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E041B3858C5F for ; Wed, 22 Jan 2025 16:13:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E041B3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E041B3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737562433; cv=none; b=kSCwatkb2C+LiPy1ws4+jsY53Mg6ZKs30x+popRRX5pn0/wJy5/fgjJXGceTvhTRjXQc6M9OfPBgb/9o2lyX+dISjdhz9lLCNg5RuqCE0wq9g88Xuq0Jk0EsLh7P8wp4lij7JQC08mWeIIDbGxx/0ixP5G/W2czG+R8gUuAnd/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737562433; c=relaxed/simple; bh=jGmTT+z7MC3VY0+k43/fzn/nK5MkwCDzJW2UcVH2Q3U=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=gaof6gz0wsZEhflMoJE/7X9wxSsZBj5L2+edKuiJ+DbAOQl9W+244aYc1AKDCVvh0RC46j9Ak9fxdzPzE+qzhtGpBg+r/DWbrKLK+CNS09tZ26yg3380u85mRLh7AfyssPpXTyVEaTX72b1WbwvhI3CrkdwyMJ6PuNk3YaUkKC8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E041B3858C5F Received: from kona.uni-regensburg.de (pc1012350290.uni-regensburg.de [132.199.97.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dilfridge) by smtp.gentoo.org (Postfix) with ESMTPSA id 46C2E340C9C; Wed, 22 Jan 2025 16:13:51 +0000 (UTC) From: dilfridge@gentoo.org To: libc-alpha@sourceware.org Cc: =?utf-8?q?Andreas_K=2E_H=C3=BCttel?= Subject: [PATCH 1/4] Makeconfig: Add libgcc directory to rtld-prefix search path Date: Wed, 22 Jan 2025 17:12:40 +0100 Message-ID: <20250122161338.141291-2-dilfridge@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122161338.141291-1-dilfridge@gentoo.org> References: <20250122161338.141291-1-dilfridge@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: Andreas K. Hüttel Signed-off-by: Andreas K. Hüttel --- Makeconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makeconfig b/Makeconfig index d0108d2caa..6b4ebd1320 100644 --- a/Makeconfig +++ b/Makeconfig @@ -692,6 +692,11 @@ link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnuli # some cases and it is preferable to link with libgcc_eh or libgcc_s # so that the testing is as similar as possible to how programs will # be built with the installed glibc. +# This leads to moderate difficulties, also since distributions may +# install libgcc_s.so in directories only found via ld.so.conf, e.g. +# to be able to switch between gcc versions. We need to add the +# corresponding directory to the library search path to make sure +# our test programs can find it. # # Some architectures have architecture-specific systems for exception # handling that may involve undefined references to @@ -709,6 +714,7 @@ libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed gnulib-arch = gnulib = -lgcc $(gnulib-arch) gnulib-tests := -lgcc $(libgcc_eh) +gnulib-extralibdir := $(shell $(CC) -print-libgcc-file-name | sed -e 's:/libgcc.*$$::') static-gnulib-arch = # By default, elf/static-stubs.o, instead of -lgcc_eh, is used to # statically link programs. When --disable-shared is used, we use @@ -781,10 +787,12 @@ endif # How to run a program we just linked with our library. # The program binary is assumed to be $(word 2,$^). +# We may require additional libraries from gcc (e.g. libgcc_s.so for exception +# handling), which unfortunately somewhat breaks the isolation. built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^)) rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \ --library-path \ - $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) + $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)):$(gnulib-extralibdir) ifeq (yes,$(build-shared)) comma = , sysdep-library-path = \