Summary: | Configuring with CC="gcc -march=x86-64-v3" --with-rtld-early-cflags=-march=x86-64 results in linker failure | ||
---|---|---|---|
Product: | glibc | Reporter: | Florian Weimer <fweimer> |
Component: | dynamic-link | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dilfridge, fweimer, hjl.tools, sam, skpgkp1, skpgkp2 |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.40 | ||
Target Milestone: | 2.40 | ||
See Also: |
https://sourceware.org/bugzilla/show_bug.cgi?id=31429 https://sourceware.org/bugzilla/show_bug.cgi?id=31867 |
||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | A patch |
Description
Florian Weimer
2024-04-23 19:12:41 UTC
Does such glibc binary require x86-64-v3 to run? (In reply to H.J. Lu from comment #1) > Does such glibc binary require x86-64-v3 to run? Yes, but we really want ld.so be able to print an error message on all CPUs, as in “Fatal glibc error: CPU does not support x86-64-v3". See sysdeps/x86/dl-get-cpu-features.c. This requires that we build part of ld.so with -march=x86-64. Created attachment 15480 [details]
A patch
Please try this.
I reproduce the issue and try attached patch; it fixes the problem. Patch looks good to me. The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=46c999741340ea559784c20a45077955b50aca43 commit 46c999741340ea559784c20a45077955b50aca43 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Apr 23 13:59:50 2024 -0700 x86: Define MINIMUM_X86_ISA_LEVEL in config.h [BZ #31676] Define MINIMUM_X86_ISA_LEVEL at configure time to avoid /usr/bin/ld: â¦/build/elf/librtld.os: in function `init_cpu_features': â¦/git/elf/../sysdeps/x86/cpu-features.c:1202: undefined reference to `_dl_runtime_resolve_fxsave' /usr/bin/ld: â¦/build/elf/librtld.os: relocation R_X86_64_PC32 against undefined hidden symbol `_dl_runtime_resolve_fxsave' can not be used when making a shared object /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status when glibc is built with -march=x86-64-v3 and configured with --with-rtld-early-cflags=-march=x86-64, which is used to allow ld.so to print an error message on unsupported CPUs: Fatal glibc error: CPU does not support x86-64-v3 This fixes BZ #31676. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com> The release/2.39/master branch has been updated by Florian Weimer <fw@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2f8f157eb0cc7f1d8d9a3fcaa8c55bed53b092a8 commit 2f8f157eb0cc7f1d8d9a3fcaa8c55bed53b092a8 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Apr 23 13:59:50 2024 -0700 x86: Define MINIMUM_X86_ISA_LEVEL in config.h [BZ #31676] Define MINIMUM_X86_ISA_LEVEL at configure time to avoid /usr/bin/ld: â¦/build/elf/librtld.os: in function `init_cpu_features': â¦/git/elf/../sysdeps/x86/cpu-features.c:1202: undefined reference to `_dl_runtime_resolve_fxsave' /usr/bin/ld: â¦/build/elf/librtld.os: relocation R_X86_64_PC32 against undefined hidden symbol `_dl_runtime_resolve_fxsave' can not be used when making a shared object /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status when glibc is built with -march=x86-64-v3 and configured with --with-rtld-early-cflags=-march=x86-64, which is used to allow ld.so to print an error message on unsupported CPUs: Fatal glibc error: CPU does not support x86-64-v3 This fixes BZ #31676. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com> (cherry picked from commit 46c999741340ea559784c20a45077955b50aca43) This is fixed on master / 2.40 then. |