about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-04-25 17:20:28 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-04-25 17:20:28 +0200
commitb62928f9070c6f3c5cc43a4cb89b4bfb950d7406 (patch)
treebfedcb4323226749f2d14e1547914fca682688a5
parent049b7684c912dd32b67b1b15b0f43bf07d5f512e (diff)
downloadglibc-b62928f9070c6f3c5cc43a4cb89b4bfb950d7406.tar.gz
glibc-b62928f9070c6f3c5cc43a4cb89b4bfb950d7406.tar.xz
glibc-b62928f9070c6f3c5cc43a4cb89b4bfb950d7406.zip
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 <hjl.tools@gmail.com>
-rw-r--r--sysdeps/x86/dl-get-cpu-features.c5
1 files changed, 5 insertions, 0 deletions
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) */
     }
 }