From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8FE8D1F4B4 for ; Tue, 20 Oct 2020 17:23:23 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8409E394CC3F; Tue, 20 Oct 2020 17:23:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8409E394CC3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603214601; bh=5UVCuXDpr2qtIuKENtU0iEduCcDJ1eDF5qdd6iYNC1o=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qROAN9zv7CZSZsC6l7D99u8Oe2Q0RnhKRMraRHxA6BAfLvKVx9wM/EAE302cAP5CI NAfljPd7dKenEzOxk4bSko0jPaQjPBBTOu9fFAupjFCN+goT2BVA0chA2C5zmJpodV /86WCiPcy8QMaPRMT8yRR67aXgHBBWmEqz+eposY= Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E98143857809 for ; Tue, 20 Oct 2020 17:23:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E98143857809 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09KH2qiB112905 for ; Tue, 20 Oct 2020 13:23:17 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34a321arax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Oct 2020 13:23:17 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09KH3aen116581 for ; Tue, 20 Oct 2020 13:23:17 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 34a321arak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Oct 2020 13:23:17 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09KHNCF9023819; Tue, 20 Oct 2020 17:23:16 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma05wdc.us.ibm.com with ESMTP id 347r88sjjy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Oct 2020 17:23:16 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09KHNGU647776236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Oct 2020 17:23:16 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C425124058; Tue, 20 Oct 2020 17:23:16 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AED3D124054; Tue, 20 Oct 2020 17:23:15 +0000 (GMT) Received: from li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com (unknown [9.80.215.159]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTPS; Tue, 20 Oct 2020 17:23:15 +0000 (GMT) Date: Tue, 20 Oct 2020 12:23:14 -0500 To: Florian Weimer Subject: Re: [PATCH 1/3] elf: Add glibc-hwcaps support for LD_LIBRARY_PATH Message-ID: <20201020172314.GA178476@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-20_10:2020-10-20, 2020-10-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010200111 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Paul A. Clarke via Libc-alpha" Reply-To: "Paul A. Clarke" Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Mon, Oct 12, 2020 at 05:21:44PM +0200, Florian Weimer via Libc-alpha wrote: > This hacks non-power-set processing into _dl_important_hwcaps. > Once the legacy hwcaps handling goes away, the subdirectory > handling needs to be reworked, but it is premature to do this > while both approaches are still supported. Why is the subject "...for LD_LIBRARY_PATH"? > --- [snip] > diff --git a/elf/Makefile b/elf/Makefile > index f10cc59e7c..4983f7a2c0 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -59,7 +59,8 @@ elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \ > # ld.so uses those routines, plus some special stuff for being the program > # interpreter and operating independent of libc. > rtld-routines = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \ > - dl-error-minimal dl-conflict dl-hwcaps dl-usage > + dl-error-minimal dl-conflict dl-hwcaps dl-hwcaps_split dl-hwcaps-subdirs \ > + dl-usage > all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) > > CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables > @@ -210,14 +211,14 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \ > tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \ > tst-audit14 tst-audit15 tst-audit16 \ > tst-single_threaded tst-single_threaded-pthread \ > - tst-tls-ie tst-tls-ie-dlmopen \ > - argv0test > + tst-tls-ie tst-tls-ie-dlmopen argv0test \ > + tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask > # reldep9 > tests-internal += loadtest unload unload2 circleload1 \ > neededtest neededtest2 neededtest3 neededtest4 \ > tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \ > tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym \ > - tst-create_format1 tst-tls-surplus > + tst-create_format1 tst-tls-surplus tst-dl-hwcaps_split > tests-container += tst-pldd tst-dlopen-tlsmodid-container \ > tst-dlopen-self-container > test-srcs = tst-pathopt > @@ -329,7 +330,10 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ > tst-single_threaded-mod3 tst-single_threaded-mod4 \ > tst-tls-ie-mod0 tst-tls-ie-mod1 tst-tls-ie-mod2 \ > tst-tls-ie-mod3 tst-tls-ie-mod4 tst-tls-ie-mod5 \ > - tst-tls-ie-mod6 > + tst-tls-ie-mod6 markermod1-1 markermod1-2 markermod1-3 \ > + markermod2-1 markermod2-2 \ > + markermod3-1 markermod3-2 markermod3-3 \ > + markermod4-1 markermod4-2 markermod4-3 markermod4-4 \ > > # Most modules build with _ISOMAC defined, but those filtered out > # depend on internal headers. > @@ -1812,3 +1816,55 @@ $(objpfx)argv0test.out: tst-rtld-argv0.sh $(objpfx)ld.so \ > '$(test-wrapper-env)' '$(run_program_env)' \ > '$(rpath-link)' 'test-argv0' > $@; \ > $(evaluate-test) > + > +# Most likely search subdirectories across multiple architectures. > +glibc-hwcaps-first-subdirs = power9 x86-64-v2 It'll be challenging for mortals to know where this information comes from and how to keep it updated when it gets stale. > +# The test modules are parameterized by preprocessor macros. > +LDFLAGS-markermod1-1.so += -Wl,-soname,markermod1.so > +LDFLAGS-markermod2-1.so += -Wl,-soname,markermod2.so > +LDFLAGS-markermod3-1.so += -Wl,-soname,markermod3.so > +LDFLAGS-markermod4-1.so += -Wl,-soname,markermod4.so > +$(objpfx)markermod%.os : markermodMARKER-VALUE.c > + $(compile-command.c) \ > + -DMARKER=marker$(firstword $(subst -, ,$*)) \ > + -DVALUE=$(lastword $(subst -, ,$*)) > +$(objpfx)markermod1.so: $(objpfx)markermod1-1.so > + cp $< $@ > +$(objpfx)markermod2.so: $(objpfx)markermod2-1.so > + cp $< $@ > +$(objpfx)markermod3.so: $(objpfx)markermod3-1.so > + cp $< $@ > +$(objpfx)markermod4.so: $(objpfx)markermod4-1.so > + cp $< $@ > + > +# tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is > +# preferred over auto-detected subdirectories. > +$(objpfx)tst-glibc-hwcaps-prepend: $(objpfx)markermod1-1.so > +$(objpfx)glibc-hwcaps/prepend-markermod1/markermod1.so: \ > + $(objpfx)markermod1-2.so > + $(make-target-directory) > + cp $< $@ > +$(objpfx)glibc-hwcaps/%/markermod1.so: $(objpfx)markermod1-3.so > + $(make-target-directory) > + cp $< $@ > +$(objpfx)tst-glibc-hwcaps-prepend.out: \ > + $(objpfx)tst-glibc-hwcaps-prepend $(objpfx)markermod1.so \ > + $(patsubst %,$(objpfx)glibc-hwcaps/%/markermod1.so,prepend-markermod1 \ > + $(glibc-hwcaps-first-subdirs)) Should this last line be indented a bit, since it is comprised of parameters from the preceding line? > + $(test-wrapper) $(rtld-prefix) \ > + --glibc-hwcaps-prepend prepend-markermod1 \ > + $< > $@; \ > + $(evaluate-test) > + > +# tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to > +# suppress all auto-detected subdirectories. > +$(objpfx)tst-glibc-hwcaps-mask: $(objpfx)markermod1-1.so > +$(objpfx)tst-glibc-hwcaps-mask.out: \ > + $(objpfx)tst-glibc-hwcaps-mask $(objpfx)markermod1.so \ > + $(patsubst %,$(objpfx)glibc-hwcaps/%/markermod1.so,\ > + $(glibc-hwcaps-first-subdirs)) Ditto. > + $(test-wrapper) $(rtld-prefix) \ > + --glibc-hwcaps-mask does-not-exist \ > + $< > $@; \ > + $(evaluate-test) [snip] PC