From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>
Subject: V5 [PATCH 0/2] x86: Support GNU_PROPERTY_X86_ISA_1_NEEDED marker [BZ #26717]
Date: Sun, 6 Dec 2020 06:49:50 -0800 [thread overview]
Message-ID: <20201206144952.2109594-1-hjl.tools@gmail.com> (raw)
GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
levels and -mneeded to emit GNU_PROPERTY_X86_ISA_1_NEEDED property with
GNU_PROPERTY_X86_ISA_1_V[234] marker.
GNU_PROPERTY_X86_ISA_1_NEEDED property in x86 ELF binaries indicate the
micro-architecture ISA level required to execute the binary. The marker
must be added by programmers explicitly in one of 3 ways:
1. Pass -mneeded to GCC.
2. Add the marker in the linker inputs as this patch does.
3. Pass -z x86-64-v[234] to the linker.
Marked elf/tst-isa-level-1 with x86-64-v4, ran it on x86-64-v3 machine
and got:
[hjl@gnu-cfl-2 build-x86_64-linux]$ ./elf/tst-isa-level-1
./elf/tst-isa-level-1: CPU ISA level is lower than required
[hjl@gnu-cfl-2 build-x86_64-linux]$
H.J. Lu (2):
x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717]
ldconfig/x86: Add ISA level check to glibc-hwcaps
config.h.in | 3 +
elf/elf.h | 35 +++---
elf/ldconfig.c | 9 +-
elf/readelflib.c | 83 ++++++++++++-
elf/readlib.c | 7 +-
elf/tst-glibc-hwcaps-2-cache.c | 45 +++++++
.../etc/ld.so.conf | 2 +
.../postclean.req | 0
elf/tst-glibc-hwcaps-2-cache.script | 6 +
sysdeps/generic/ldconfig.h | 9 +-
sysdeps/generic/read-prop.h | 32 +++++
sysdeps/unix/sysv/linux/x86/read-prop.h | 57 +++++++++
sysdeps/unix/sysv/linux/x86/readelflib.c | 67 +++++++++--
sysdeps/unix/sysv/linux/x86_64/Makefile | 26 ++++
.../sysv/linux/x86_64/tst-glibc-hwcaps-2.c | 50 ++++++++
.../linux/x86_64/x86-64-isa-level-VALUE.c | 4 +
sysdeps/x86/Makefile | 10 ++
sysdeps/x86/abi-note.c | 29 +++++
sysdeps/x86/configure | 101 ++++++++++++++++
sysdeps/x86/configure.ac | 26 ++++
sysdeps/x86/cpu-features.c | 3 +
sysdeps/x86/dl-cet.c | 12 +-
sysdeps/x86/dl-prop.h | 113 +++++++++++++-----
sysdeps/x86/get-isa-level.h | 66 ++++++++++
sysdeps/x86/include/cpu-features.h | 2 +
sysdeps/x86/isa-level.c | 95 +++++++++++++++
sysdeps/x86/link_map.h | 18 +--
sysdeps/x86/tst-isa-level-1.c | 74 ++++++++++++
sysdeps/x86/tst-isa-level-mod-1.c | 23 ++++
sysdeps/x86/tst-isa-level-mod-1a.c | 2 +
sysdeps/x86/tst-isa-level-mod-1b.c | 1 +
sysdeps/x86_64/dl-hwcaps-subdirs.c | 30 ++---
sysdeps/x86_64/tst-glibc-hwcaps.c | 41 ++-----
33 files changed, 950 insertions(+), 131 deletions(-)
create mode 100644 elf/tst-glibc-hwcaps-2-cache.c
create mode 100644 elf/tst-glibc-hwcaps-2-cache.root/etc/ld.so.conf
create mode 100644 elf/tst-glibc-hwcaps-2-cache.root/postclean.req
create mode 100644 elf/tst-glibc-hwcaps-2-cache.script
create mode 100644 sysdeps/generic/read-prop.h
create mode 100644 sysdeps/unix/sysv/linux/x86/read-prop.h
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-glibc-hwcaps-2.c
create mode 100644 sysdeps/unix/sysv/linux/x86_64/x86-64-isa-level-VALUE.c
create mode 100644 sysdeps/x86/abi-note.c
create mode 100644 sysdeps/x86/get-isa-level.h
create mode 100644 sysdeps/x86/isa-level.c
create mode 100644 sysdeps/x86/tst-isa-level-1.c
create mode 100644 sysdeps/x86/tst-isa-level-mod-1.c
create mode 100644 sysdeps/x86/tst-isa-level-mod-1a.c
create mode 100644 sysdeps/x86/tst-isa-level-mod-1b.c
--
2.28.0
next reply other threads:[~2020-12-06 14:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 14:49 H.J. Lu [this message]
2020-12-06 14:49 ` V5 [PATCH 1/2] x86: Support GNU_PROPERTY_X86_ISA_1_V[234] " H.J. Lu
2021-01-06 12:00 ` Adhemerval Zanella
2021-01-06 17:11 ` V6 " H.J. Lu
2021-01-07 20:09 ` Adhemerval Zanella
2021-01-07 20:58 ` H.J. Lu
2021-01-18 11:17 ` Florian Weimer
2021-01-18 13:49 ` H.J. Lu
2021-01-18 15:15 ` Florian Weimer
2020-12-06 14:49 ` V5 [PATCH 2/2] ldconfig/x86: Add ISA level check to glibc-hwcaps H.J. Lu
2020-12-07 10:00 ` Florian Weimer
2020-12-08 13:25 ` H.J. Lu
2020-12-08 13:31 ` Florian Weimer
2020-12-08 14:10 ` H.J. Lu
2020-12-08 14:18 ` Florian Weimer
2020-12-08 14:23 ` H.J. Lu
2020-12-08 15:15 ` Florian Weimer
2020-12-08 15:31 ` H.J. Lu
2020-12-09 3:27 ` [PATCH] ldconfig/x86: Store ISA level in cache and aux cache H.J. Lu
2021-01-12 16:25 ` Adhemerval Zanella
2021-01-12 23:32 ` V2 " H.J. Lu
2021-01-13 13:47 ` Adhemerval Zanella
2021-01-13 14:12 ` H.J. Lu
2021-01-28 20:20 ` Florian Weimer
2021-01-28 20:43 ` H.J. Lu
2021-01-29 8:56 ` Florian Weimer
2021-01-29 12:44 ` H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201206144952.2109594-1-hjl.tools@gmail.com \
--to=hjl.tools@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).