From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id B65873858C50; Thu, 25 Apr 2024 15:20:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B65873858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1714058446; bh=Ol8q4Vw8ZYVHNSQrRoQ55BcBPaR8+qjhxGbJ5ntcjtU=; h=From:To:Subject:Date:From; b=QecfR6psBL3BWQ5YuoQJB0Yq6RYDZLpw7O310kkRBQMXSZqm7AOBj/EXSlpm7RiCE n4nZmFq+TIfN8BDe2hoJWZyzBH+pOPx5MDQaiN5VV5nJ4UylZ79DhNAhM9rd3nSn6M VJsv+BpfilfsOMkX0aUWvfE1D5XOqC+USQJchDlk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] x86: In ld.so, diagnose missing APX support in APX-only builds X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 049b7684c912dd32b67b1b15b0f43bf07d5f512e X-Git-Newrev: b62928f9070c6f3c5cc43a4cb89b4bfb950d7406 Message-Id: <20240425152046.B65873858C50@sourceware.org> Date: Thu, 25 Apr 2024 15:20:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b62928f9070c6f3c5cc43a4cb89b4bfb950d7406 commit b62928f9070c6f3c5cc43a4cb89b4bfb950d7406 Author: Florian Weimer Date: Thu Apr 25 17:20:28 2024 +0200 x86: In ld.so, diagnose missing APX support in APX-only builds At this point, this is mainly a tool for testing the early ld.so CPU compatibility diagnostics: GCC uses the new instructions in most functions, so it's easy to spot if some of the early code is not built correctly. Reviewed-by: H.J. Lu Diff: --- sysdeps/x86/dl-get-cpu-features.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c index 4d6c5c59a6..579d02d638 100644 --- a/sysdeps/x86/dl-get-cpu-features.c +++ b/sysdeps/x86/dl-get-cpu-features.c @@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4); # endif /* ISA level 4 */ # endif /* ISA level 3 */ # endif /* ISA level 2 */ +# ifdef GCCMACRO__APX_F__ + if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F)) + _dl_fatal_printf ("\ +Fatal glibc error: CPU does not support APX\n"); +# endif # endif /* IS_IN (rtld) */ } }