From patchwork Fri Jan 14 12:40:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 50024 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 6A3793835C11 for ; Fri, 14 Jan 2022 12:40:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A3793835C11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1642164038; bh=aoACYG8ihqMV4tNoa77ZK5avpqcwgBxli61Q9MX4BCM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=idoKjwk2WMFIrcnWOYJQ6yif1oFIRRolTsTHXWZ36Z3cOCc4zmMfR2wPgIGOkb8PK n8oJvmPTILld5uEbvSpUw+bYqhOo+uvBE0T76keAi8rHAkJ5TDEtr2ZGaU/QlOwAuA 1ES3WrYO0/EicBbpU7DmGCm/w6RjfmL4Bkrzd1r8= 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 08A033858D35 for ; Fri, 14 Jan 2022 12:40:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 08A033858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-378-TIw7qHRCNM2-M1dLrFM9Qg-1; Fri, 14 Jan 2022 07:40:06 -0500 X-MC-Unique: TIw7qHRCNM2-M1dLrFM9Qg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9962C84BA40; Fri, 14 Jan 2022 12:40:05 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AD367CD6B; Fri, 14 Jan 2022 12:40:03 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 0/7] Reliable CPU compatibility diagnostics in ld.so X-From-Line: 201e517c6a751bebe505af99e35a9f8643066f31 Mon Sep 17 00:00:00 2001 Message-Id: Date: Fri, 14 Jan 2022 13:40:02 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: Tulio Magno Quites Machado Filho , Stefan Liebler Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This series enables reliable CPU compatibility diagnostics by building the early parts of the dynamic loader with an older ISA level than the rest of glibc. I tested this with our POWER9 build flags (running on POWER8), and with -march=x86-64-v4 on a x86-64-v3 system. In both cases, an accurate erorr is printed. Also built with build-many-glibcs.py, and tested on i686-linux-gnu and x86_64-linux-gnu,. Florian Weimer (7): x86: HAVE_X86_LAHF_SAHF, HAVE_X86_MOVBE and -march=x86-64-vN (bug 28782) Generate gcc-macros.h elf: Split dl-printf.c from dl-misc.c Add --early-cflags configure option powerpc64le: Use in early HWCAP check x86: Add x86-64-vN check to early startup s390x: Use in early HWCAP check Makeconfig | 9 + config.make.in | 1 + configure | 13 + configure.ac | 6 + elf/Makefile | 10 +- elf/dl-misc.c | 281 +---------------- elf/dl-printf.c | 292 ++++++++++++++++++ manual/install.texi | 7 + sysdeps/powerpc/powerpc64/le/dl-hwcap-check.h | 9 +- sysdeps/s390/s390-64/dl-hwcap-check.h | 5 +- sysdeps/x86/Makefile | 1 + sysdeps/x86/configure | 4 +- sysdeps/x86/configure.ac | 4 +- sysdeps/x86/dl-get-cpu-features.c | 31 +- 14 files changed, 384 insertions(+), 289 deletions(-) create mode 100644 elf/dl-printf.c base-commit: 4997a533ae4b51ef66a6b68862b7578a7acb82df