From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id C0CE33858426; Mon, 23 Oct 2023 16:44:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0CE33858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1698079473; bh=TYrw76AbvkoTl/n6yI9P1Y1vSNsNkg+PrcEupTVhM2Y=; h=From:To:Subject:Date:From; b=HJuiVHjRB5n9fG/ykHrOKpSuL6wCwcZi5EOwhq/wie1IXMSQoUcjrVV63PdsKoINk Ga0jW6B7v8DqQz5yVpftqEMsv0vFVDUUrGmSh/kxlVN7a4qtRixkatRcyw5K+mudK2 TFnp6VTJmwN+AbowKq9uIWdcWUjM9TF1EL/VFMUQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] test-container: disable ld.so system cache on DSO detection X-Act-Checkin: glibc X-Git-Author: Simon Chopin X-Git-Refname: refs/heads/master X-Git-Oldrev: 31aaf6fed986fade042f9ffe7535d8b3f2c173a2 X-Git-Newrev: 97290559c3b497fb9012c3f6248cb30afb26da7c Message-Id: <20231023164433.C0CE33858426@sourceware.org> Date: Mon, 23 Oct 2023 16:44:33 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=97290559c3b497fb9012c3f6248cb30afb26da7c commit 97290559c3b497fb9012c3f6248cb30afb26da7c Author: Simon Chopin Date: Thu Oct 5 14:54:31 2023 +0200 test-container: disable ld.so system cache on DSO detection When building the testroot, the script runs the newly built ld.so on a couple of binaries in order to copy over any additional libraries needed. However, if the dependencies are found in the system cache, it will be copied over using that path. This is problematic if the system ld.so and the one built don't have the exact same search configuration. We encountered this in Ubuntu, where we build a variant of libc with -fno-omit-frame-pointer for accurate performance profiling. This variant is built using a non-standard slibdir to be able to be co-installed with the default library (e.g. slibdir = /lib/libc6-prof). Since we have /lib pointing to /usr/lib, any additional dependency should still be reachable via /usr. However, resolving via the cache might result in the additional DSOs being copied into $testroot/lib, out of the search path in the container. The problem has been triggered by 1d5024f4f052c12e404d42d3b5bfe9c3e9fd27c4 ("support: Build with exceptions and asynchronous unwind tables [BZ #30587]") which introduced a dependency on libgcc_s.so.1 under some circumstances. Downstream bug: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2031495 Reviewed-by: Adhemerval Zanella Diff: --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c6d4817a9e..b938721166 100644 --- a/Makefile +++ b/Makefile @@ -624,7 +624,7 @@ $(objpfx)testroot.pristine/install.stamp : ifeq ($(run-built-tests),yes) # Copy these DSOs first so we can overwrite them with our own. for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ - $(rtld-prefix) \ + $(rtld-prefix) --inhibit-cache \ $(objpfx)testroot.pristine/bin/sh \ | sed -n '/\//{s@.*=> /@/@;s/^[^/]*//;s/ .*//p;}'` ;\ do \ @@ -633,7 +633,7 @@ ifeq ($(run-built-tests),yes) $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\ done for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ - $(rtld-prefix) \ + $(rtld-prefix) --inhibit-cache \ $(objpfx)support/$(LINKS_DSO_PROGRAM) \ | sed -n '/\//{s@.*=> /@/@;s/^[^/]*//;s/ .*//p;}'` ;\ do \