]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Move CET infrastructure to x86_64
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 5 Jan 2024 12:32:37 +0000 (09:32 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Jan 2024 16:55:51 +0000 (13:55 -0300)
The CET is only supported for x86_64 and there is no plan to add
kernel support for i386.  Move the Makefile rules and files from the
generic x86 folder to x86_64 one.

Checked on x86_64-linux-gnu and i686-linux-gnu.

62 files changed:
sysdeps/unix/sysv/linux/x86/Makefile
sysdeps/unix/sysv/linux/x86_64/Makefile
sysdeps/unix/sysv/linux/x86_64/include/asm/prctl.h [moved from sysdeps/unix/sysv/linux/x86/include/asm/prctl.h with 100% similarity]
sysdeps/unix/sysv/linux/x86_64/tst-cet-property-1.c [moved from sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c with 100% similarity]
sysdeps/unix/sysv/linux/x86_64/tst-cet-property-2.c [moved from sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c with 100% similarity]
sysdeps/unix/sysv/linux/x86_64/tst-cet-property-dep-2.S [moved from sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S with 100% similarity]
sysdeps/unix/sysv/linux/x86_64/tst-cet-setcontext-1.c [moved from sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c with 100% similarity]
sysdeps/unix/sysv/linux/x86_64/tst-cet-vfork-1.c [moved from sysdeps/unix/sysv/linux/x86/tst-cet-vfork-1.c with 100% similarity]
sysdeps/x86/Makefile
sysdeps/x86_64/Makefile
sysdeps/x86_64/tst-cet-legacy-1.c [moved from sysdeps/x86/tst-cet-legacy-1.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-10-static.c [moved from sysdeps/x86/tst-cet-legacy-10-static.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-10.c [moved from sysdeps/x86/tst-cet-legacy-10.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-10a-static.c [moved from sysdeps/x86/tst-cet-legacy-10a-static.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-10a.c [moved from sysdeps/x86/tst-cet-legacy-10a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-1a.c [moved from sysdeps/x86/tst-cet-legacy-1a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-2.c [moved from sysdeps/x86/tst-cet-legacy-2.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-2a.c [moved from sysdeps/x86/tst-cet-legacy-2a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-3.c [moved from sysdeps/x86/tst-cet-legacy-3.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-4.c [moved from sysdeps/x86/tst-cet-legacy-4.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-4a.c [moved from sysdeps/x86/tst-cet-legacy-4a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-4b.c [moved from sysdeps/x86/tst-cet-legacy-4b.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-4c.c [moved from sysdeps/x86/tst-cet-legacy-4c.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-5.c [moved from sysdeps/x86/tst-cet-legacy-5.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-5a.c [moved from sysdeps/x86/tst-cet-legacy-5a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-5b.c [moved from sysdeps/x86/tst-cet-legacy-5b.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-6.c [moved from sysdeps/x86/tst-cet-legacy-6.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-6a.c [moved from sysdeps/x86/tst-cet-legacy-6a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-6b.c [moved from sysdeps/x86/tst-cet-legacy-6b.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-7.c [moved from sysdeps/x86/tst-cet-legacy-7.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-8.c [moved from sysdeps/x86/tst-cet-legacy-8.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-9-static.c [moved from sysdeps/x86/tst-cet-legacy-9-static.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-9.c [moved from sysdeps/x86/tst-cet-legacy-9.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-1.c [moved from sysdeps/x86/tst-cet-legacy-mod-1.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-2.c [moved from sysdeps/x86/tst-cet-legacy-mod-2.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-4.c [moved from sysdeps/x86/tst-cet-legacy-mod-4.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-5.c [moved from sysdeps/x86/tst-cet-legacy-mod-5.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-5a.c [moved from sysdeps/x86/tst-cet-legacy-mod-5a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-5b.c [moved from sysdeps/x86/tst-cet-legacy-mod-5b.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-5c.c [moved from sysdeps/x86/tst-cet-legacy-mod-5c.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-6.c [moved from sysdeps/x86/tst-cet-legacy-mod-6.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-6a.c [moved from sysdeps/x86/tst-cet-legacy-mod-6a.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-6b.c [moved from sysdeps/x86/tst-cet-legacy-mod-6b.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-6c.c [moved from sysdeps/x86/tst-cet-legacy-mod-6c.c with 100% similarity]
sysdeps/x86_64/tst-cet-legacy-mod-6d.c [moved from sysdeps/x86/tst-cet-legacy-mod-6d.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1-extra.S [moved from sysdeps/x86/tst-shstk-legacy-1-extra.S with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1a-static.c [moved from sysdeps/x86/tst-shstk-legacy-1a-static.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1a.c [moved from sysdeps/x86/tst-shstk-legacy-1a.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1b-static.c [moved from sysdeps/x86/tst-shstk-legacy-1b-static.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1b.c [moved from sysdeps/x86/tst-shstk-legacy-1b.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1c-static.c [moved from sysdeps/x86/tst-shstk-legacy-1c-static.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1c.c [moved from sysdeps/x86/tst-shstk-legacy-1c.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1d-static.c [moved from sysdeps/x86/tst-shstk-legacy-1d-static.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1d.c [moved from sysdeps/x86/tst-shstk-legacy-1d.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1e-static.c [moved from sysdeps/x86/tst-shstk-legacy-1e-static.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1e-static.sh [moved from sysdeps/x86/tst-shstk-legacy-1e-static.sh with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1e.c [moved from sysdeps/x86/tst-shstk-legacy-1e.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1e.sh [moved from sysdeps/x86/tst-shstk-legacy-1e.sh with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1f.c [moved from sysdeps/x86/tst-shstk-legacy-1f.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1g.c [moved from sysdeps/x86/tst-shstk-legacy-1g.c with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-1g.sh [moved from sysdeps/x86/tst-shstk-legacy-1g.sh with 100% similarity]
sysdeps/x86_64/tst-shstk-legacy-mod-1.c [moved from sysdeps/x86/tst-shstk-legacy-mod-1.c with 100% similarity]

index 9dfdd689a909c7209fc5f018f0acb02cf2c673c9..743b633b65fcf972fce6a1860b460ffd2a1baab9 100644 (file)
@@ -21,30 +21,3 @@ endif
 ifeq ($(subdir),setjmp)
 tests += tst-saved_mask-1
 endif
-
-ifneq ($(enable-cet),no)
-ifeq ($(subdir),elf)
-tests += tst-cet-property-1 tst-cet-property-2
-
-CFLAGS-tst-cet-property-1.o += -fcf-protection
-ASFLAGS-tst-cet-property-dep-2.o += -fcf-protection
-
-$(objpfx)tst-cet-property-2: $(objpfx)tst-cet-property-dep-2.o
-$(objpfx)tst-cet-property-2.out: $(objpfx)tst-cet-property-2 \
-                                $(objpfx)tst-cet-property-1.out
-       env $(run-program-env) $(test-via-rtld-prefix) \
-         $(objpfx)tst-cet-property-2 \
-         < $(objpfx)tst-cet-property-1.out > $@; \
-         $(evaluate-test)
-endif
-
-ifeq ($(subdir),posix)
-tests += tst-cet-vfork-1
-CFLAGS-tst-cet-vfork-1.c += -mshstk
-endif
-
-ifeq ($(subdir),stdlib)
-tests += tst-cet-setcontext-1
-CFLAGS-tst-cet-setcontext-1.c += -mshstk
-endif
-endif
index 06b873949e36fadfdad26ebe0f89a05b4b257930..4223feb95f6fe2f570f1770e5e8c2a749147a1ff 100644 (file)
@@ -64,3 +64,30 @@ $(objpfx)libx86-64-isa-level.so: $(objpfx)libx86-64-isa-level-1.so
        cp $< $@
 endif
 endif # $(subdir) == elf
+
+ifneq ($(enable-cet),no)
+ifeq ($(subdir),elf)
+tests += tst-cet-property-1 tst-cet-property-2
+
+CFLAGS-tst-cet-property-1.o += -fcf-protection
+ASFLAGS-tst-cet-property-dep-2.o += -fcf-protection
+
+$(objpfx)tst-cet-property-2: $(objpfx)tst-cet-property-dep-2.o
+$(objpfx)tst-cet-property-2.out: $(objpfx)tst-cet-property-2 \
+                                $(objpfx)tst-cet-property-1.out
+       env $(run-program-env) $(test-via-rtld-prefix) \
+         $(objpfx)tst-cet-property-2 \
+         < $(objpfx)tst-cet-property-1.out > $@; \
+         $(evaluate-test)
+endif
+
+ifeq ($(subdir),posix)
+tests += tst-cet-vfork-1
+CFLAGS-tst-cet-vfork-1.c += -mshstk
+endif
+
+ifeq ($(subdir),stdlib)
+tests += tst-cet-setcontext-1
+CFLAGS-tst-cet-setcontext-1.c += -mshstk
+endif
+endif
index 5c8ab64c4d655cbc2acfe31009b1ef583fc4a5ef..bf913594c19b8c92dca732cc0411f25ce6a74468 100644 (file)
@@ -93,12 +93,6 @@ endif # $(subdir) == math
 ifeq ($(subdir),setjmp)
 gen-as-const-headers += jmp_buf-ssp.sym
 sysdep_routines += __longjmp_cancel
-ifneq ($(enable-cet),no)
-tests += \
-  tst-setjmp-cet \
-# tests
-tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
-endif
 endif
 
 ifeq ($(subdir),string)
@@ -139,238 +133,6 @@ CFLAGS-tst-wcscmp-rtm.c += -mrtm
 CFLAGS-tst-wcsncmp-rtm.c += -mrtm -Wno-error
 endif
 
-ifneq ($(enable-cet),no)
-ifeq ($(subdir),elf)
-sysdep-dl-routines += dl-cet
-
-tests += \
-  tst-cet-legacy-1 \
-  tst-cet-legacy-1a \
-  tst-cet-legacy-2 \
-  tst-cet-legacy-2a \
-  tst-cet-legacy-3 \
-  tst-cet-legacy-4 \
-  tst-cet-legacy-5a \
-  tst-cet-legacy-6a \
-  tst-cet-legacy-7 \
-  tst-cet-legacy-8 \
-  tst-cet-legacy-9 \
-  tst-cet-legacy-9-static \
-  tst-cet-legacy-10 \
-  tst-cet-legacy-10-static \
-  tst-cet-legacy-10a \
-  tst-cet-legacy-10a-static \
-# tests
-tests-static += \
-  tst-cet-legacy-9-static \
-  tst-cet-legacy-10-static \
-  tst-cet-legacy-10a-static \
-# tests-static
-tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
-
-tests += \
-  tst-shstk-legacy-1a \
-  tst-shstk-legacy-1a-static \
-  tst-shstk-legacy-1b \
-  tst-shstk-legacy-1b-static \
-  tst-shstk-legacy-1c \
-  tst-shstk-legacy-1c-static \
-  tst-shstk-legacy-1d \
-  tst-shstk-legacy-1d-static \
-  tst-shstk-legacy-1e \
-  tst-shstk-legacy-1e-static \
-  tst-shstk-legacy-1f \
-  tst-shstk-legacy-1g \
-# tests
-modules-names += \
-  tst-shstk-legacy-mod-1 \
-# modules-names
-tests-static += \
-  tst-shstk-legacy-1a-static \
-  tst-shstk-legacy-1b-static \
-  tst-shstk-legacy-1c-static \
-  tst-shstk-legacy-1d-static \
-  tst-shstk-legacy-1e-static \
-# tests-static
-extra-objs += \
-  tst-shstk-legacy-1-extra.o \
-# extra-objs
-
-tests += \
-  tst-cet-legacy-4a \
-  tst-cet-legacy-4b \
-  tst-cet-legacy-4c \
-  tst-cet-legacy-5b \
-  tst-cet-legacy-6b \
-# tests
-modules-names += \
-  tst-cet-legacy-mod-1 \
-  tst-cet-legacy-mod-2 \
-  tst-cet-legacy-mod-4 \
-  tst-cet-legacy-mod-5a \
-  tst-cet-legacy-mod-5b \
-  tst-cet-legacy-mod-5c \
-  tst-cet-legacy-mod-6a \
-  tst-cet-legacy-mod-6b \
-  tst-cet-legacy-mod-6c \
-# modules-names
-
-CFLAGS-tst-cet-legacy-2.c += -fcf-protection=none -fcf-protection=branch
-CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
-CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-4.c += -fcf-protection=none -fcf-protection=branch
-CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
-CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
-CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
-CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
-ifeq ($(enable-cet),permissive)
-CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
-endif
-CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
-CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
-CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=none -fcf-protection=branch
-CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
-CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
-CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
-ifeq ($(enable-cet),permissive)
-CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
-endif
-CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
-CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
-CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=none -fcf-protection=branch
-CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
-CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
-CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-10.c += -mshstk
-CFLAGS-tst-cet-legacy-10-static.c += -mshstk
-CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none
-CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none
-
-tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-
-CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
-CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
-CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
-CFLAGS-tst-shstk-legacy-1d-static.c += -fcf-protection=none
-CFLAGS-tst-shstk-legacy-1f.c += -fcf-protection=none
-
-$(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
-                      $(objpfx)tst-cet-legacy-mod-2.so
-$(objpfx)tst-cet-legacy-1a: $(objpfx)tst-cet-legacy-mod-1.so \
-                      $(objpfx)tst-cet-legacy-mod-2.so
-$(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so
-$(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
-$(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so
-$(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
-$(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
-$(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
-                               $(objpfx)tst-cet-legacy-mod-5b.so
-$(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
-$(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
-$(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
-                               $(objpfx)tst-cet-legacy-mod-6b.so
-$(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
-$(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
-LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
-$(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
-tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
-$(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
-tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
-$(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
-tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
-$(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
-                               $(objpfx)tst-cet-legacy-mod-5b.so
-tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
-$(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
-                               $(objpfx)tst-cet-legacy-mod-6b.so
-tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
-tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
-tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
-
-tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-$(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
-tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-$(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
-tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
-tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
-$(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
-tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-$(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1e-static: $(objpfx)tst-shstk-legacy-1-extra.o
-$(objpfx)tst-shstk-legacy-1e.out: \
-  $(..)/sysdeps/x86/tst-shstk-legacy-1e.sh $(objpfx)tst-shstk-legacy-1e
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
-       $(evaluate-test)
-$(objpfx)tst-shstk-legacy-1e-static.out: \
-  $(..)/sysdeps/x86/tst-shstk-legacy-1e-static.sh \
-  $(objpfx)tst-shstk-legacy-1e-static
-       $(SHELL) $< $(common-objpfx) 2> $@; \
-       $(evaluate-test)
-tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
-$(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
-$(objpfx)tst-shstk-legacy-mod-1.so: \
-  $(objpfx)tst-shstk-legacy-mod-1.os \
-  $(objpfx)tst-shstk-legacy-1-extra.os
-$(objpfx)tst-shstk-legacy-1g: $(objpfx)tst-shstk-legacy-mod-1.so
-$(objpfx)tst-shstk-legacy-1g.out: \
-  $(..)/sysdeps/x86/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
-       $(evaluate-test)
-endif
-
-# Add -fcf-protection to CFLAGS when CET is enabled.
-CFLAGS-.o += -fcf-protection
-CFLAGS-.os += -fcf-protection
-CFLAGS-.op += -fcf-protection
-CFLAGS-.oS += -fcf-protection
-
-# Compile assembly codes with <cet.h> when CET is enabled.
-asm-CPPFLAGS += -fcf-protection -include cet.h
-
-ifeq ($(subdir),elf)
-ifeq (yes,$(build-shared))
-tests-special += $(objpfx)check-cet.out
-endif
-
-# FIXME: Can't use all-built-dso in elf/Makefile since this file is
-# processed before elf/Makefile.  Duplicate it here.
-cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
-                $(filter-out $(common-objpfx)linkobj/libc.so, \
-                             $(sort $(wildcard $(addprefix $(common-objpfx), \
-                                                           */lib*.so \
-                                                           iconvdata/*.so))))
-
-$(cet-built-dso:=.note): %.note: %
-       @rm -f $@T
-       LC_ALL=C $(READELF) -n $< > $@T
-       test -s $@T
-       mv -f $@T $@
-common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
-
-$(objpfx)check-cet.out: $(..)sysdeps/x86/check-cet.awk \
-                       $(cet-built-dso:=.note)
-       LC_ALL=C $(AWK) -f $^ > $@; \
-       $(evaluate-test)
-generated += check-cet.out
-endif
-endif
-
 ifeq ($(subdir),posix)
 tests += \
   tst-sysconf-cache-linesize \
index 836e03a224dd1f57f191ce9ce66e77cdb3a5aa10..98f0e04f90834ac9acde6ea59f2b5e9b69706d91 100644 (file)
@@ -233,6 +233,249 @@ tests += \
   tst-rsi-wcslen
 endif
 
+
+ifeq ($(subdir),setjmp)
+ifneq ($(enable-cet),no)
+tests += \
+  tst-setjmp-cet \
+# tests
+tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
+endif
+endif
+
+
+ifneq ($(enable-cet),no)
+ifeq ($(subdir),elf)
+sysdep-dl-routines += dl-cet
+
+tests += \
+  tst-cet-legacy-1 \
+  tst-cet-legacy-1a \
+  tst-cet-legacy-2 \
+  tst-cet-legacy-2a \
+  tst-cet-legacy-3 \
+  tst-cet-legacy-4 \
+  tst-cet-legacy-5a \
+  tst-cet-legacy-6a \
+  tst-cet-legacy-7 \
+  tst-cet-legacy-8 \
+  tst-cet-legacy-9 \
+  tst-cet-legacy-9-static \
+  tst-cet-legacy-10 \
+  tst-cet-legacy-10-static \
+  tst-cet-legacy-10a \
+  tst-cet-legacy-10a-static \
+# tests
+tests-static += \
+  tst-cet-legacy-9-static \
+  tst-cet-legacy-10-static \
+  tst-cet-legacy-10a-static \
+# tests-static
+tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
+
+tests += \
+  tst-shstk-legacy-1a \
+  tst-shstk-legacy-1a-static \
+  tst-shstk-legacy-1b \
+  tst-shstk-legacy-1b-static \
+  tst-shstk-legacy-1c \
+  tst-shstk-legacy-1c-static \
+  tst-shstk-legacy-1d \
+  tst-shstk-legacy-1d-static \
+  tst-shstk-legacy-1e \
+  tst-shstk-legacy-1e-static \
+  tst-shstk-legacy-1f \
+  tst-shstk-legacy-1g \
+# tests
+modules-names += \
+  tst-shstk-legacy-mod-1 \
+# modules-names
+tests-static += \
+  tst-shstk-legacy-1a-static \
+  tst-shstk-legacy-1b-static \
+  tst-shstk-legacy-1c-static \
+  tst-shstk-legacy-1d-static \
+  tst-shstk-legacy-1e-static \
+# tests-static
+extra-objs += \
+  tst-shstk-legacy-1-extra.o \
+# extra-objs
+
+tests += \
+  tst-cet-legacy-4a \
+  tst-cet-legacy-4b \
+  tst-cet-legacy-4c \
+  tst-cet-legacy-5b \
+  tst-cet-legacy-6b \
+# tests
+modules-names += \
+  tst-cet-legacy-mod-1 \
+  tst-cet-legacy-mod-2 \
+  tst-cet-legacy-mod-4 \
+  tst-cet-legacy-mod-5a \
+  tst-cet-legacy-mod-5b \
+  tst-cet-legacy-mod-5c \
+  tst-cet-legacy-mod-6a \
+  tst-cet-legacy-mod-6b \
+  tst-cet-legacy-mod-6c \
+# modules-names
+
+CFLAGS-tst-cet-legacy-2.c += -fcf-protection=none -fcf-protection=branch
+CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-4.c += -fcf-protection=none -fcf-protection=branch
+CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
+CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
+CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
+ifeq ($(enable-cet),permissive)
+CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
+endif
+CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
+CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
+CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=none -fcf-protection=branch
+CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
+CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
+ifeq ($(enable-cet),permissive)
+CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
+endif
+CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
+CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
+CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=none -fcf-protection=branch
+CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
+CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-10.c += -mshstk
+CFLAGS-tst-cet-legacy-10-static.c += -mshstk
+CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none
+
+tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+
+CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
+CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
+CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
+CFLAGS-tst-shstk-legacy-1d-static.c += -fcf-protection=none
+CFLAGS-tst-shstk-legacy-1f.c += -fcf-protection=none
+
+$(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
+                      $(objpfx)tst-cet-legacy-mod-2.so
+$(objpfx)tst-cet-legacy-1a: $(objpfx)tst-cet-legacy-mod-1.so \
+                      $(objpfx)tst-cet-legacy-mod-2.so
+$(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so
+$(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
+$(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so
+$(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
+$(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
+$(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
+                               $(objpfx)tst-cet-legacy-mod-5b.so
+$(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
+$(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
+$(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
+                               $(objpfx)tst-cet-legacy-mod-6b.so
+$(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
+$(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
+LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
+$(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
+$(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
+$(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
+$(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
+                               $(objpfx)tst-cet-legacy-mod-5b.so
+tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
+$(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
+                               $(objpfx)tst-cet-legacy-mod-6b.so
+tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
+tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
+tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
+
+tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+$(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
+tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+$(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
+tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
+tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
+$(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
+tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+$(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1e-static: $(objpfx)tst-shstk-legacy-1-extra.o
+$(objpfx)tst-shstk-legacy-1e.out: \
+  $(..)/sysdeps/x86_64/tst-shstk-legacy-1e.sh $(objpfx)tst-shstk-legacy-1e
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
+       $(evaluate-test)
+$(objpfx)tst-shstk-legacy-1e-static.out: \
+  $(..)/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh \
+  $(objpfx)tst-shstk-legacy-1e-static
+       $(SHELL) $< $(common-objpfx) 2> $@; \
+       $(evaluate-test)
+tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+$(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
+$(objpfx)tst-shstk-legacy-mod-1.so: \
+  $(objpfx)tst-shstk-legacy-mod-1.os \
+  $(objpfx)tst-shstk-legacy-1-extra.os
+$(objpfx)tst-shstk-legacy-1g: $(objpfx)tst-shstk-legacy-mod-1.so
+$(objpfx)tst-shstk-legacy-1g.out: \
+  $(..)/sysdeps/x86_64/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
+       $(evaluate-test)
+endif
+
+# Add -fcf-protection to CFLAGS when CET is enabled.
+CFLAGS-.o += -fcf-protection
+CFLAGS-.os += -fcf-protection
+CFLAGS-.op += -fcf-protection
+CFLAGS-.oS += -fcf-protection
+
+# Compile assembly codes with <cet.h> when CET is enabled.
+asm-CPPFLAGS += -fcf-protection -include cet.h
+
+ifeq ($(subdir),elf)
+ifeq (yes,$(build-shared))
+tests-special += $(objpfx)check-cet.out
+endif
+
+# FIXME: Can't use all-built-dso in elf/Makefile since this file is
+# processed before elf/Makefile.  Duplicate it here.
+cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
+                $(filter-out $(common-objpfx)linkobj/libc.so, \
+                             $(sort $(wildcard $(addprefix $(common-objpfx), \
+                                                           */lib*.so \
+                                                           iconvdata/*.so))))
+
+$(cet-built-dso:=.note): %.note: %
+       @rm -f $@T
+       LC_ALL=C $(READELF) -n $< > $@T
+       test -s $@T
+       mv -f $@T $@
+common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
+
+$(objpfx)check-cet.out: $(..)sysdeps/x86/check-cet.awk \
+                       $(cet-built-dso:=.note)
+       LC_ALL=C $(AWK) -f $^ > $@; \
+       $(evaluate-test)
+generated += check-cet.out
+endif # $(subdir) == elf
+endif # $(enable) != no
+
 do-tests-clean common-mostlyclean: tst-x86_64-1-clean
 
 .PHONY: tst-x86_64-1-clean