]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: In ld.so, diagnose missing APX support in APX-only builds
authorFlorian Weimer <fweimer@redhat.com>
Thu, 25 Apr 2024 15:20:28 +0000 (17:20 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 25 Apr 2024 15:20:28 +0000 (17:20 +0200)
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>
sysdeps/x86/dl-get-cpu-features.c

index 4d6c5c59a6bbaf2b0c4eac8e7397e1b6d7e06458..579d02d63821465fb0fd2345c6f9fd6939b92995 100644 (file)
@@ -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) */
     }
 }