From patchwork Sat Nov 8 21:11:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 123816 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 AC55E3858C2D for ; Sat, 8 Nov 2025 21:12:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC55E3858C2D X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 3C9B43858CDB for ; Sat, 8 Nov 2025 21:11:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C9B43858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C9B43858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762636294; cv=none; b=kR78b9AEQh0K/wM7Q66h/lOrS9v/UCOaprRzPJ5/F3pc+Lmnn8EdSdTs9cCXQF9Ru+VWVMfEVAyCRfQLSLQsuzeUNXYufufaamltXFgPg4xArmtTIujo3wL3TD1DG0zJh38lTRlUAOC0mg/lgpLIXqRHZIIy3MyV0o0akHXtMnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762636294; c=relaxed/simple; bh=N1QAy5Cs52Ia0jKVTbmMqx+qWtyNSuzmd69nHSwD4qw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ZWmdIbXw1ZADKkNe57b0AuhbIsmGSvDu4JhaYVijb0wShO3VPmLY1WWtzeFdvc/ArCc/dWCdENfMBwTPR1gcKajM5qfiGxiow/Urs/1juLuCj7HYPIP/wWcZjzJ3Ilo2NlTRBTV2RFKoQRFgkO7MxZFw2t23GY0Xrl2BwcYuaNU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C9B43858CDB Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 396B3A1A57; Sat, 8 Nov 2025 22:11:33 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lqujez6We_XS; Sat, 8 Nov 2025 22:11:33 +0100 (CET) Received: from end (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id F3094A1A53; Sat, 8 Nov 2025 22:11:32 +0100 (CET) Received: from samy by end with local (Exim 4.98.2) (envelope-from ) id 1vHqDc-00000003sg7-1zqN; Sat, 08 Nov 2025 22:11:32 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited] Add missing $(rpath-link) to elf/ld.so --library-path Date: Sat, 8 Nov 2025 22:11:31 +0100 Message-ID: <20251108211132.925160-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 This is notably needed for GNU/Hurd's libmachuser.so and libhurduser.so. --- elf/Makefile | 2 +- elf/tst-pathopt.sh | 4 +++- scripts/dso-ordering-test.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index 5a676f858d..7ed95b72af 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1913,7 +1913,7 @@ $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ $(objpfx)pathoptobj.so $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \ - '$(run-program-env)'; \ + '$(run-program-env)' '$(rpath-link)' ; \ $(evaluate-test) $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so diff --git a/elf/tst-pathopt.sh b/elf/tst-pathopt.sh index b1539c8ee9..c44cbee0c7 100755 --- a/elf/tst-pathopt.sh +++ b/elf/tst-pathopt.sh @@ -22,6 +22,8 @@ set -e common_objpfx=$1 test_wrapper_env=$2 run_program_env=$3 +# Remove the last space to allow concatenate extra paths. +library_path=$(echo $4) test -e ${common_objpfx}elf/will-be-empty && rm -fr ${common_objpfx}elf/will-be-empty @@ -32,7 +34,7 @@ cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so ${test_wrapper_env} \ ${run_program_env} \ -LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \ +LD_LIBRARY_PATH=$library_path:${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \ ${common_objpfx}elf/ld.so ${common_objpfx}elf/tst-pathopt \ > ${common_objpfx}elf/tst-pathopt.out diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py index d5ae50fd2c..0912550f1d 100644 --- a/scripts/dso-ordering-test.py +++ b/scripts/dso-ordering-test.py @@ -748,7 +748,7 @@ def process_testcase(t): ("${test_wrapper_env} ${run_program_env} %s\\\n" "${common_objpfx}support/test-run-command \\\n" "${common_objpfx}elf/ld.so \\\n" - "--library-path ${common_objpfx}elf/%s:" + "--library-path $library_path:${common_objpfx}elf/%s:" "${common_objpfx}elf:${common_objpfx}.:" "${common_objpfx}dlfcn \\\n" "${common_objpfx}elf/%s/%s > \\\n" @@ -1021,6 +1021,8 @@ def process_testcase(t): t.sh.write("common_objpfx=$1\n") t.sh.write("test_wrapper_env=$2\n") t.sh.write("run_program_env=$3\n") + # Remove the last space to allow concatenate extra paths. + t.sh.write("library_path=$(echo $4)\n") t.sh.write("something_failed=false\n") # Starting part of Makefile fragment @@ -1050,7 +1052,7 @@ def process_testcase(t): % (t.test_name, test_srcdir, t.test_name, expected_output_files)) makefile.write("\t$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' " - "'$(run-program-env)' > $@; $(evaluate-test)\n") + "'$(run-program-env)' '$(rpath-link)' > $@; $(evaluate-test)\n") makefile.write("ifeq ($(run-built-tests),yes)\n") if t.xtest: makefile.write("xtests-special += $(objpfx)%s.out\n" % (t.test_name))