Summary: | "CPU ISA level is lower than required" on SSE2-free CPUs | ||
---|---|---|---|
Product: | glibc | Reporter: | Sam James <sam> |
Component: | build | Assignee: | H.J. Lu <hjl.tools> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | awilfox, carlos, hjl.tools, skpgkp2 |
Priority: | P2 | ||
Version: | 2.39 | ||
Target Milestone: | 2.40 | ||
See Also: |
https://sourceware.org/bugzilla/show_bug.cgi?id=31676 https://bugs.gentoo.org/show_bug.cgi?id=933764 https://sourceware.org/bugzilla/show_bug.cgi?id=31868 https://sourceware.org/bugzilla/show_bug.cgi?id=31883 |
||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | A patch |
Description
Sam James
2024-06-09 08:36:09 UTC
In sysdeps/x86/isa-level.h, we correctly do: ``` #if defined __SSE__ && defined __SSE2__ /* NB: ISAs, excluding MMX, in x86-64 ISA level baseline are used. */ # define __X86_ISA_V1 1 #else # define __X86_ISA_V1 0 #endif ``` But when we run the configure test, we do... ``` cat > conftest.c <<EOF #include <sysdeps/x86/isa-level.h> #if MINIMUM_X86_ISA_LEVEL >= 4 libc_cv_have_x86_isa_level=4 #elif MINIMUM_X86_ISA_LEVEL == 3 libc_cv_have_x86_isa_level=3 #elif MINIMUM_X86_ISA_LEVEL == 2 libc_cv_have_x86_isa_level=2 #else libc_cv_have_x86_isa_level=baseline #endif EOF ``` On a CPU without SSE2, we will get 'baseline', and then... ``` if test $libc_cv_have_x86_isa_level = baseline; then AC_DEFINE_UNQUOTED(MINIMUM_X86_ISA_LEVEL, 1) else AC_DEFINE_UNQUOTED(MINIMUM_X86_ISA_LEVEL, $libc_cv_have_x86_isa_level) fi ``` We set MINIMUM_X86_ISA_LEVEL to 1, not 0, which seems wrong. I still see the v3 marker appearing unexpectedly, so investigating more. (In reply to Sam James from comment #2) > I still see the v3 marker appearing unexpectedly, so investigating more. (Is there a way to get bfd to print why it's adding a marker? e.g. inherited from X obj) (In reply to Sam James from comment #2) > I still see the v3 marker appearing unexpectedly, so investigating more. I think ignore the v3 thing. This appears to be a separate issue. (In reply to Sam James from comment #3) > (In reply to Sam James from comment #2) > > I still see the v3 marker appearing unexpectedly, so investigating more. > > (Is there a way to get bfd to print why it's adding a marker? e.g. inherited > from X obj) I'll file a bfd bug for discussion. -- Patch posted by awilfox: https://inbox.sourceware.org/libc-alpha/20240609133933.62366-1-AWilcox@Wilcox-Tech.com/T/#u Created attachment 15573 [details]
A patch
Please try this.
(In reply to Sam James from comment #4) > > Patch posted by awilfox: > https://inbox.sourceware.org/libc-alpha/20240609133933.62366-1- > AWilcox@Wilcox-Tech.com/T/#u This is wrong since the minimum ISA level for x86-64 is 1, not 0. (In reply to H.J. Lu from comment #5) > Created attachment 15573 [details] > A patch > > Please try this. This works. Thanks! Tested-by: Ian Jordan <immoloism@gmail.com> Reviewed-by: Sam James <sam@gentoo.org> The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=09bc68b0ac26331a0109f0578c9368e09176da18 commit 09bc68b0ac26331a0109f0578c9368e09176da18 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Jun 10 13:02:06 2024 -0700 x86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867] On i386, set the default minimum ISA level to 0, not 1 (baseline which includes SSE2). There are no changes in config.h nor in config.make on x86-64. This fixes BZ #31867. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Tested-by: Ian Jordan <immoloism@gmail.com> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Florian Weimer <fweimer@redhat.com> The release/2.39/master branch has been updated by Sam James <sjames@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b7f5b0a7114e29577daf64e68970673b61e5fcba commit b7f5b0a7114e29577daf64e68970673b61e5fcba Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Jun 10 13:02:06 2024 -0700 x86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867] On i386, set the default minimum ISA level to 0, not 1 (baseline which includes SSE2). There are no changes in config.h nor in config.make on x86-64. This fixes BZ #31867. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Tested-by: Ian Jordan <immoloism@gmail.com> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 09bc68b0ac26331a0109f0578c9368e09176da18) |