From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by sourceware.org (Postfix) with ESMTPS id 3C936385840E; Fri, 10 May 2024 03:59:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C936385840E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C936385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715313556; cv=none; b=kuyzXocgUTGXjt3kIJxMBXHTWaXLRAC/zh4oLBGg2TydS/n7EPvvjgEdBe8jXOHLEZcuPbcl9J/ll0gHE7XeYN0tgH/XhwBi5D0mIBWI+6hMvKIVdopApttK70OXgm3eY9vPCdqpjzy4ljWGP3n0Tv+yuuKxwFVE9WrsTRWGsQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715313556; c=relaxed/simple; bh=RnBcMBNdb1HB8/b1+14+K2FzVo3cIhflnR5PWzTjJiU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=wRRKJWqVHPPS9sJ6h5uhHziDY8L7z1mJj8rBGLF8kXadQabxY38ROeOp5WOrrCDZgb9w02N2+yzpz9DkwCboH/sD9STvBnk6nDGMIbIua0UTc9d+ep4lsa/IH14WEKA/ACDsOXhrGSS7hKLk9cfhXcGTg58GfjHuiI/u7hxY4vo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-62026f59233so12354697b3.1; Thu, 09 May 2024 20:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715313554; x=1715918354; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=coKD2DYjVeabeZg03YhnTPsTa3OHS8aT4NLaDxiT1/o=; b=Ri7Cs7seBOOgc7iwOVap5UE10FPD3GSrv7gXbT2TTSx5sK6CdIl+EIalZIhscA/bRa p8Bq/84wzzMgvlCGRruPtsSMNUvUUClGyN6srf1exlTSBc6vmiGXTgCiO/MQROwrB9FP U/R/9NVrIYCHSxCe6K9PnhFfTT63dPvp5kM7A6UZvk1soYK2VrUdhPes45SBNNGLQEQF +KS17CB83VCGOOOa54llhnPFab7OxQd95jVvptOP6xvZltVyZyKXB3qw2J98+hlyfrFb e2hhwxgaTIJd1+o+UGdMzMaxeVqU/hq5HWCamB+5WrECXQVaLwS8MtXAR2O20DL+y7B2 vp6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715313554; x=1715918354; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=coKD2DYjVeabeZg03YhnTPsTa3OHS8aT4NLaDxiT1/o=; b=LdvGFwAn+2nkCdAiE2Nq8XeZSpekUgL3zokFNyy5ojnZa9+yafS0801u0oboZk9r3s Yp5uPcODOXUhAPEuKMYGgNySdi9GNmfecVWjncjnh5RIeiWZBnHG+MWtYXH54s1VRDPk iv3ZDvJeLgZLQfYu1rUGdSXCiV3hpdJydCF7hicTRoqhXy26x/sbm8b8hZ07kxJghzZ6 g67iZoWFDuEzVxrrOpaCzhubDEu8KSQ0KrOj+0SHF+Gq49jyovxuE8mohfq2lOSXOznE Z3+37Zvgbwk4BKdoG4wQ/e2MSH7q/SBwJRkrIntrMVhR4BtwZFP+ZpQxQ22BozKKa2Nq fPXA== X-Forwarded-Encrypted: i=1; AJvYcCUjISsaJF6ASs70J/G0/kD0r3+gylfTLqhQngpKRhUCp6T0eVjM16mhTbpAfr98LxbP3wfUOVesW6kq4Lo4MEC3Ps3zAcxIq6Wj X-Gm-Message-State: AOJu0YxD2+lzo0oW/6W7c1xMqaqOIm/q5heqoOQk5T92hAyR8fTDVB24 Tfp9rN+3iEX6yQMfLTDiFEz/f3f/4enLcEA55CdocVMPkbb6A7rQNDHZ+VuR5C1qRav3O5wTDFM +FddhzLa9BbQG0GPRBMdHOBEFv5s= X-Google-Smtp-Source: AGHT+IGdVm1Rr2LsxAeq9r3m+P5olgynKdIbsWhXAShSgjA8h3uvTR5OvxFDEEkNf6s/RRcfJUrBMSdrqlgITbolSt8= X-Received: by 2002:a0d:db05:0:b0:61a:e979:427e with SMTP id 00721157ae682-6209939b53amr39515797b3.11.1715313554486; Thu, 09 May 2024 20:59:14 -0700 (PDT) MIME-Version: 1.0 References: <20240510030701.834418-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Thu, 9 May 2024 20:58:38 -0700 Message-ID: Subject: Re: [PATCH] Force DT_RPATH for --enable-hardcoded-path-in-tests To: Sunil Pandey Cc: Libc-stable Mailing List , libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3019.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 List-Id: On Thu, May 9, 2024 at 8:56=E2=80=AFPM Sunil Pandey wro= te: > > > > On Thu, May 9, 2024 at 8:07=E2=80=AFPM H.J. Lu wrot= e: >> >> On Fedora 40/x86-64, linker enables --enable-new-dtags by default which >> generates DT_RUNPATH instead of DT_RPATH. Unlike DT_RPATH, DT_RUNPATH >> only applies to DT_NEEDED entries in the executable and doesn't applies >> to DT_NEEDED entries in shared libraries which are loaded via DT_NEEDED >> entries in the executable. Some glibc tests have libstdc++.so.6 in >> DT_NEEDED, which has libm.so.6 in DT_NEEDED. When DT_RUNPATH is generat= ed, >> /lib64/libm.so.6 is loaded for such tests. If the newly built glibc is >> older than glibc 2.36, these tests fail with >> >> assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-releas= e/build-x86_64-linux/libc.so.6: version `GLIBC_2.36' not found (required by= /lib64/libm.so.6) >> assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-releas= e/build-x86_64-linux/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (requ= ired by /lib64/libm.so.6) >> >> Pass -Wl,--disable-new-dtags to linker when building glibc tests with >> --enable-hardcoded-path-in-tests. This fixes BZ #31719. >> >> Signed-off-by: H.J. Lu >> --- >> Makeconfig | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/Makeconfig b/Makeconfig >> index 61ff1d0d9b..59e21d4c82 100644 >> --- a/Makeconfig >> +++ b/Makeconfig >> @@ -607,10 +607,13 @@ link-libc-rpath-link =3D -Wl,-rpath-link=3D$(rpath= -link) >> # before the expansion of LDLIBS-* variables). >> >> # Tests use -Wl,-rpath instead of -Wl,-rpath-link for >> -# build-hardcoded-path-in-tests. >> +# build-hardcoded-path-in-tests. Add -Wl,--disable-new-dtags to force >> +# DT_RPATH instead of DT_RUNPATH which only applies to DT_NEEDED entrie= s >> +# in the executable and doesn't applies to DT_NEEDED entries in shared >> +# libraries which are loaded via DT_NEEDED entries in the executable. >> ifeq (yes,$(build-hardcoded-path-in-tests)) >> -link-libc-tests-rpath-link =3D $(link-libc-rpath) >> -link-test-modules-rpath-link =3D $(link-libc-rpath) >> +link-libc-tests-rpath-link =3D $(link-libc-rpath) -Wl,--disable-new-dta= gs >> +link-test-modules-rpath-link =3D $(link-libc-rpath) -Wl,--disable-new-d= tags >> else >> link-libc-tests-rpath-link =3D $(link-libc-rpath-link) >> link-test-modules-rpath-link =3D >> -- >> 2.45.0 >> > > I would like to backport this patch to release branches up to 2.28. > Any comments or objections? > OK. --=20 H.J.