[PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds
Florian Weimer
fweimer@redhat.com
Thu Apr 25 14:58:41 GMT 2024
* H. J. Lu:
> On Thu, Apr 25, 2024 at 5:11 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> 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. (No such problems were flagged for the current
>> tree.)
>>
>> ---
>> 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) */
>> }
>> }
>>
>> base-commit: 3a3a4497421422aa854c855cbe5110ca7d598ffc
>>
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Thanks.
> BTW, this patch:
>
> https://patchwork.sourceware.org/project/glibc/list/?series=33161
>
> is also required.
Oh, I didn't test with GLIBC_TUNABLES. I'm going to remove the
incorrect claim from the commit message.
Florian
More information about the Libc-alpha
mailing list