From patchwork Wed Jan 10 21:15:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 83795 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 73E1F385842F for ; Wed, 10 Jan 2024 21:15:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id ACFF33858D38 for ; Wed, 10 Jan 2024 21:15:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACFF33858D38 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 ACFF33858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704921340; cv=none; b=bOrD/zNfyeWS1I2DvS+V5Ocyo0vRjGilFpg+E58h0J/WdHbITT+NU8Ov6WMNyzuKeK9Q6r+kZ8IqXaVOIFRuwxsg778a+cOOcbbi07zp50gCMIXRgYAcEeRZzar9io33M1Ltv0dNN8e9/Y83pJ79DDvsXX6ghiwVVDGsncQR0NU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704921340; c=relaxed/simple; bh=3i1Fw40ui3dXaR4JfqdkIOuuP0T0s4ycspLAPQHRh+g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=T7l8JkAE+AiZ7PsOSvNDSr82PPJjNSwgn2FcQWWJ9N5pjs+vsLc6HTexg4akx5GKS2KCK6pnqjNYwoJoYX90PZcH8whm7XF2gmWq1aUxCs83tA5+Xic8JOwtksq2xg2Nr2xpBteUDZsRkefrdJ81d/4Dqs7Bka6q3+YilQXoBIY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704921338; 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=vED+FmhtZq2+Egf45b9dy52eMVNoIQGwr2CLIe3Ltlo=; b=HnXC1YGj49OZwKB0bO9Zt66W/sj9n3r7yRaty6RNCZpDhuQCRjUgdF2F+uG2o55BdOuAUc 2PmiRNAhSvtpVojoCcosRWFtd92BfBHyvSH4nDgaxBX7H1bzAcmRRhPCcAx5YhglPT7xF6 CCbDVQO6DHTHlTyH0nlrxlqAIgdw7RQ= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-8OPYzsZFNXeDPIrN4-lVMA-1; Wed, 10 Jan 2024 16:15:37 -0500 X-MC-Unique: 8OPYzsZFNXeDPIrN4-lVMA-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7832c437dceso265184985a.1 for ; Wed, 10 Jan 2024 13:15:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704921336; x=1705526136; 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=vED+FmhtZq2+Egf45b9dy52eMVNoIQGwr2CLIe3Ltlo=; b=a816bALWLFor9e7OmTc+zEMOP+F7Slbxl4PZ8rQ/E+4c2tbTdQ7Q9vq6vUhyz2CEdz fCVJHseSaVK+/1mTGloxI+ASC7H/pVLT4wBTrF3c8+u/khApaGDCkL+pGd/fsutAdplX sZIftN1QRUoJfK+bBT6kAZWruIkDh27eYPEMJDij0GKYJ1vyGKG08syea0AzBAnHYIoW kUchs6Bx8PZ/JxUxbRpTCdbLHkVv/2G9P7xme7w4iJaB71k8gN/tM9ztfWlcfBpF0/61 VyNCfOEqZMvMcI5X4q5hpvfl4OLNxIY7nakZ2tr0rrczjGuWRyydmqa1KzeDxafLHjEL DElw== X-Gm-Message-State: AOJu0Yx0K8nEMwfdCjXex6fm1tT6rVjo7KtlWJ+Y+eDe/4s+Bb3HzhFt JH+l5K/CPGhUCpV3fgdLBoDvLcBwD0UHD95wQ75q9rGFkvaHa6h0d2cegvezw91nX2mhEo4OkgC vkONEexcuyiccsT+Xaqgg6OPUOtprGy02g6a+1Yfkz0e7tNBOZarpw6cQRaAIf0TviGotDS3Jli 1Ncy4Kpse1NA== X-Received: by 2002:a05:620a:4707:b0:781:67a8:bfae with SMTP id bs7-20020a05620a470700b0078167a8bfaemr289752qkb.44.1704921336471; Wed, 10 Jan 2024 13:15:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbzgNWNBMeU/procx4WRyYdNSexvW/Ex7XkofbuN1q9PqHoRyqSbrzgjzZVHWZAk5Pk7q2IQ== X-Received: by 2002:a05:620a:4707:b0:781:67a8:bfae with SMTP id bs7-20020a05620a470700b0078167a8bfaemr289739qkb.44.1704921336140; Wed, 10 Jan 2024 13:15:36 -0800 (PST) Received: from localhost.localdomain ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id vr20-20020a05620a55b400b0078322b61e88sm1884189qkn.78.2024.01.10.13.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 13:15:33 -0800 (PST) From: Carlos O'Donell To: libc-alpha@sourceware.org Cc: Carlos O'Donell , Florian Weimer Subject: [PATCH v2] elf: Fix tst-nodeps2 test failure. Date: Wed, 10 Jan 2024 16:15:09 -0500 Message-ID: <20240110211521.532816-1-carlos@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.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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 After 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate libc.so early during startup and dlmopen (bug 31083)") we start seeing tst-nodeps2 failures when building the testsuite with --enable-hard-coded-path-in-tests. When building the testsuite with --enable-hard-coded-path-in-tests the tst-nodeps2-mod.so is not built with the required DT_RUNPATH values and the test escapes the test framework and loads the system libraries and aborts. The fix is to use the existing $(link-test-modules-rpath-link) variable to set DT_RUNPATH correctly. No regressions on x86_64. Reviewed-by: Florian Weimer --- elf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elf/Makefile b/elf/Makefile index 600812e573..5d78b659ce 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3022,6 +3022,8 @@ $(objpfx)tst-env-setuid: $(objpfx)tst-sonamemove-runmod2.so $(objpfx)tst-env-setuid-static.out: $(objpfx)tst-sonamemove-runmod1.so # The object tst-nodeps1-mod.so has no explicit dependencies on libc.so. +# We do not use $(link-test-modules-rpath-link) since the object has no +# DT_NEEDED. $(objpfx)tst-nodeps1-mod.so: $(objpfx)tst-nodeps1-mod.os $(LINK.o) -nostartfiles -nostdlib -shared -o $@ $^ tst-nodeps1.so-no-z-defs = yes @@ -3032,7 +3034,8 @@ $(objpfx)tst-nodeps1: $(objpfx)tst-nodeps1-mod.so # with the IFUNC resolver reference. $(objpfx)tst-nodeps2-mod.so: $(common-objpfx)libc.so \ $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.os - $(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^ + $(LINK.o) -Wl,--no-as-needed -nostartfiles -nostdlib -shared -o $@ $^ \ + $(link-test-modules-rpath-link) $(objpfx)tst-nodeps2.out: \ $(objpfx)tst-nodeps1-mod.so $(objpfx)tst-nodeps2-mod.so