From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D2FBE3857C4A for ; Tue, 9 Aug 2022 10:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2FBE3857C4A Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-264-QGkLx2RYNoWl_qPRwaq9uQ-1; Tue, 09 Aug 2022 06:32:37 -0400 X-MC-Unique: QGkLx2RYNoWl_qPRwaq9uQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01974824061; Tue, 9 Aug 2022 10:32:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 453E240C1288; Tue, 9 Aug 2022 10:32:36 +0000 (UTC) From: Florian Weimer To: Mathieu Malaterre Cc: libc-help@sourceware.org Subject: Re: riscv64: ld.so hardware capabilities / V extension 1.0 References: Date: Tue, 09 Aug 2022 12:32:34 +0200 In-Reply-To: (Mathieu Malaterre's message of "Tue, 9 Aug 2022 10:42:49 +0200") Message-ID: <877d3hn1vh.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2022 10:32:43 -0000 * Mathieu Malaterre: > Dear ld.so maintainers, > > I see that from time to time subdirectories are added to the search > path of ld.so. For example I see that commit 45ff34638f0 added the > sub-directory `avx512_1`. > > I tried to make sense of the (outdated?) documentation from: > > * https://man7.org/linux/man-pages/man8/ld.so.8.html > > but I failed to understand when new subdirectories are being added to ld.so ? The old mechanism with AT_PLATFORM did not work. The new mechanism is glibc-hwcaps, where capabilities are ordered, ideally with each capability being a superset of the previous one. You only need to supply one file, dl-hwcaps-subdirs.c, that defines _dl_hwcaps_subdirs and _dl_hwcaps_subdirs_active. This commit provides an example of how to do this: commit fdf8fbca455ca3ef57235bde907bcc6a624ac5aa Author: Florian Weimer Date: Thu Dec 10 13:51:18 2020 +0100 s390x: Add glibc-hwcaps support Subdirectories z13, z14, z15 can be selected, mostly based on the level of support for vector instructions. Co-Authored-By: Stefan Liebler Ideally, you add similar tests to what's included in that commit. I'd also strongly recommend to document the glibc-hwcaps levels in the psABI supplement because they need to be consistent across toolchain components. If you want to generate nice diagnostics when glibc itself is built with a higher ISA level, you'll have to add your own dl-hwcap-check.h Thanks, Florian