From patchwork Thu Oct 5 12:54:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Chopin X-Patchwork-Id: 77163 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 01C223875DC8 for ; Thu, 5 Oct 2023 12:55:27 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by sourceware.org (Postfix) with ESMTPS id 771FC385DC14 for ; Thu, 5 Oct 2023 12:55:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 771FC385DC14 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 5EA753F131 for ; Thu, 5 Oct 2023 12:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696510513; bh=8IewadaUQScqbk35252alHXNIMW1ixsdkiHVZeWCUoY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=bE+9x39BIeWZIJ5OIYTQdeNvz/onH2NdcQ++T7xur7FQessTsxHfztA3f/7NSI6Ee XV4R4u9gMUifPkMPF4qNx29GnVdRv4aFfOqDxbdFYAJaELz5xXS76vBnfGoyKanjcF rs2aOYtD1svfg/tESOdRlQjrgDba3/tVpXls+VS3eyWsJpnG3mkr4bMnv3Vg6Y7+8O fU6VmiRNy9iG9izeeQbH5Y7x2YUQrS5PFiQjscUh9Qv9VCzpcc3cWNsTKutVTTES7h jWGHkvbGEvC/dQZrvBpsFI/bLkNiwc9pfXcbc/XruEQYnFEYW3dhNVcId3UItk+bV9 nuYLRLlDvoNaA== Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4054016ff33so4784555e9.1 for ; Thu, 05 Oct 2023 05:55:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696510513; x=1697115313; 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=8IewadaUQScqbk35252alHXNIMW1ixsdkiHVZeWCUoY=; b=guSrQac+10mIlBYD4D9rstPU3fLZr2nGudVE4wYVmaUKeCHtOO5mI7AtODjwTVUmcF x/JCTsqysdTqG+RvcxT5RBOygHqasnseNsci+xOXGMv2SeZgp9CserO18USla9n08Gk+ hzNXdAKtmi1+tqm750KP2c20UdZvxNID71Jk7yf8TylsYOHy7FBCRXNfXM+JgyTkm9/v aYkyfNIu9DRTXVEBOI+SM17NE0FKX1Cni30mduQqUAal36xg0ooOcLTXHT6+gI9ILv7y Y0Y6T7M1yauVJbINeF9vSDz7w2fn2GsAUfLBM5K6YRZWiioU+1gaHA5fmsFTVlEsP1/7 O6zg== X-Gm-Message-State: AOJu0YwxC3ywvicrwdM5IYOz5ZgIEjoXwSZ0NBZ7buBJotjLtUGsGJ5j hXswinZ+XvTAsHjc5O6gvNo72xYXVy+SmFuSWuXfIDZNfeC+dKBX9C0c55p4lvXr+XHv5dNdzwL IQ0WdmGO9cqYoqhIAZYTCQjX9vGLqYpds4vrQM8Vb/2tTVA== X-Received: by 2002:a05:600c:1c96:b0:405:3622:382c with SMTP id k22-20020a05600c1c9600b004053622382cmr1362859wms.17.1696510512854; Thu, 05 Oct 2023 05:55:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoF/s+GG1pgkl/5gKW1rrJmt/U7VLuTUD3+Igv0G6cPzETRgCRHPRHxj4oyzT67h4WoY/kGA== X-Received: by 2002:a05:600c:1c96:b0:405:3622:382c with SMTP id k22-20020a05600c1c9600b004053622382cmr1362850wms.17.1696510512545; Thu, 05 Oct 2023 05:55:12 -0700 (PDT) Received: from localhost ([2a01:e0a:169:7380:5ec8:8ad7:871f:4fcb]) by smtp.gmail.com with ESMTPSA id az41-20020a05600c602900b004068495910csm3634638wmb.23.2023.10.05.05.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 05:55:12 -0700 (PDT) From: Simon Chopin To: libc-alpha@sourceware.org Cc: Simon Chopin Subject: [PATCH] test-container: disable ld.so system cache on DSO detection Date: Thu, 5 Oct 2023 14:54:31 +0200 Message-Id: <20231005125431.3958485-1-simon.chopin@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, 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 When building the testroot, the script runs the newly built ld.so on a couple of binaries in order to copy over any additional libararies 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 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 1056e5b4c3f2d90ed2b4a55f96add28da2f4c8fa 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 \