On Tue, Oct 13, 2020 at 4:49 AM H.J. Lu wrote: > > On Tue, Oct 13, 2020 at 3:32 AM Florian Weimer wrote: > > > > * H. J. Lu via Libc-alpha: > > > > > GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA > > > levels: > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250 > > > > > > Binutils has been updated to support GNU_PROPERTY_X86_ISA_1_V[234] marker: > > > > > > https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13 > > > > > > with > > > > > > commit 32930e4edbc06bc6f10c435dbcc63131715df678 > > > Author: H.J. Lu > > > Date: Fri Oct 9 05:05:57 2020 -0700 > > > > > > x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker > > > > > > in x86 ELF binaries to indicate the micro-architecture ISA level required > > > to execute the binary. > > > > I'm not sure if this is the right design. But maybe it helps to get > > vendors to stop releasing new v2-only CPUs. 8-/ > > > > > Add GNU_PROPERTY_X86_ISA_1_V[234] marker support to ld.so if binutils > > > 2.32 or newer is used to build glibc: > > > > > > 1. Add GNU_PROPERTY_X86_ISA_1_V[234] markers to elf.h. > > > 2. Add GNU_PROPERTY_X86_ISA_1_V[234] marker to abi-note.o based on the > > > ISA level used to compile abi-note.o, assuming that the same ISA level > > > is used to compile the whole glibc. > > > 3. Add isa_1 to cpu_features to record the supported x86 ISA level. > > > 4. Rename _dl_process_cet_property_note to _dl_process_property_note and > > > add GNU_PROPERTY_X86_ISA_1_V[234] marker detection. > > > 5. Update _rtld_main_check and _dl_open_check to check loaded objects > > > with the incompatible ISA level. > > > 6. Add a testcase to verify that dlopen an x86-64-v4 shared object fails > > > on lesser platforms. > > > > It's not clear based on this description if the expectation is that the > > search for alternative implementations continues after an attempt to > > load an object fails due to an architecture level mismatch. > > > > 1. ldconfig should issue an error for shared objects with mismatched ISA > level and mark such shared objects in ld.so cache. > 2. ld.so should skip shared objects with incompatible ISA level similar to > EM_386 shared objects. If ld.so detects it after loading such a shared > object, ld.so should issue a hard error. > Here is the updated patch to properly handle both GNU_PROPERTY_X86_FEATURE_1_AND and GNU_PROPERTY_X86_ISA_1_NEEDED. -- H.J.