|
Packit |
6c4009 |
ifeq ($(subdir),csu)
|
|
Packit |
6c4009 |
gen-as-const-headers += cpu-features-offsets.sym
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq ($(subdir),elf)
|
|
Packit |
6c4009 |
sysdep-dl-routines += dl-get-cpu-features
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
tests += tst-get-cpu-features tst-get-cpu-features-static
|
|
Packit |
6c4009 |
tests-static += tst-get-cpu-features-static
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq ($(subdir),setjmp)
|
|
Packit |
6c4009 |
gen-as-const-headers += jmp_buf-ssp.sym
|
|
Packit |
6c4009 |
sysdep_routines += __longjmp_cancel
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit Service |
a5aa78 |
ifneq ($(enable-cet),no)
|
|
Packit |
6c4009 |
ifeq ($(subdir),elf)
|
|
Packit |
6c4009 |
sysdep-dl-routines += dl-cet
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
tests += tst-cet-legacy-1 tst-cet-legacy-2 tst-cet-legacy-2a \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-3 tst-cet-legacy-4 \
|
|
Packit Service |
42c491 |
tst-cet-legacy-5a tst-cet-legacy-6a tst-cet-legacy-7 \
|
|
Packit Service |
42c491 |
tst-cet-legacy-8
|
|
Packit |
6c4009 |
ifneq (no,$(have-tunables))
|
|
Packit Service |
fdfd71 |
tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-5b tst-cet-legacy-6b
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-mod-4 tst-cet-legacy-mod-5a \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-mod-5b tst-cet-legacy-mod-5c \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-mod-6a tst-cet-legacy-mod-6b \
|
|
Packit Service |
fdfd71 |
tst-cet-legacy-mod-6c
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-2.c += -fcf-protection=branch
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-4.c += -fcf-protection=branch
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
|
|
Packit Service |
a5aa78 |
CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
|
|
Packit Service |
a5aa78 |
ifeq ($(enable-cet),permissive)
|
|
Packit Service |
a5aa78 |
CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
|
|
Packit Service |
a5aa78 |
endif
|
|
Packit Service |
a5aa78 |
CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
|
|
Packit Service |
a5aa78 |
CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
|
|
Packit Service |
42c491 |
CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=branch
|
|
Packit Service |
fdfd71 |
CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
|
|
Packit Service |
fdfd71 |
CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
|
|
Packit Service |
a5aa78 |
CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
|
|
Packit Service |
a5aa78 |
ifeq ($(enable-cet),permissive)
|
|
Packit Service |
a5aa78 |
CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
|
|
Packit Service |
a5aa78 |
endif
|
|
Packit Service |
a5aa78 |
CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
|
|
Packit Service |
a5aa78 |
CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
|
|
Packit Service |
42c491 |
CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=branch
|
|
Packit Service |
fdfd71 |
CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
|
|
Packit Service |
fdfd71 |
CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
|
|
Packit Service |
42c491 |
CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
|
|
Packit Service |
42c491 |
CFLAGS-tst-cet-legacy-8.c += -mshstk
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-mod-2.so
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4: $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-5a: $(libdl)
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-5b.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-6a: $(libdl)
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-6b.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
|
|
Packit Service |
fdfd71 |
LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
|
|
Packit |
6c4009 |
ifneq (no,$(have-tunables))
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4a: $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
|
|
Packit Service |
9550b6 |
tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4b: $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
|
|
Packit Service |
9550b6 |
tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4c: $(libdl)
|
|
Packit |
6c4009 |
$(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
|
|
Packit Service |
9550b6 |
tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-5b: $(libdl)
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-5b.so
|
|
Packit Service |
9550b6 |
tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=off:glibc.cpu.x86_shstk=off
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-6b: $(libdl)
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
|
|
Packit Service |
fdfd71 |
$(objpfx)tst-cet-legacy-mod-6b.so
|
|
Packit Service |
9550b6 |
tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=off:glibc.cpu.x86_shstk=off
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Add -fcf-protection to CFLAGS when CET is enabled.
|
|
Packit |
6c4009 |
CFLAGS-.o += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-.os += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-.op += -fcf-protection
|
|
Packit |
6c4009 |
CFLAGS-.oS += -fcf-protection
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Compile assembly codes with <cet.h> when CET is enabled.
|
|
Packit |
6c4009 |
asm-CPPFLAGS += -fcf-protection -include cet.h
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq ($(subdir),elf)
|
|
Packit |
6c4009 |
ifeq (yes,$(build-shared))
|
|
Packit |
6c4009 |
tests-special += $(objpfx)check-cet.out
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# FIXME: Can't use all-built-dso in elf/Makefile since this file is
|
|
Packit |
6c4009 |
# processed before elf/Makefile. Duplicate it here.
|
|
Packit |
6c4009 |
cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
|
|
Packit |
6c4009 |
$(filter-out $(common-objpfx)linkobj/libc.so, \
|
|
Packit |
6c4009 |
$(sort $(wildcard $(addprefix $(common-objpfx), \
|
|
Packit |
6c4009 |
*/lib*.so \
|
|
Packit |
6c4009 |
iconvdata/*.so))))
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
$(cet-built-dso:=.note): %.note: %
|
|
Packit |
6c4009 |
@rm -f $@T
|
|
Packit |
6c4009 |
LC_ALL=C $(READELF) -n $< > $@T
|
|
Packit |
6c4009 |
test -s $@T
|
|
Packit |
6c4009 |
mv -f $@T $@
|
|
Packit |
6c4009 |
common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
$(objpfx)check-cet.out: $(..)sysdeps/x86/check-cet.awk \
|
|
Packit |
6c4009 |
$(cet-built-dso:=.note)
|
|
Packit |
6c4009 |
LC_ALL=C $(AWK) -f $^ > $@; \
|
|
Packit |
6c4009 |
$(evaluate-test)
|
|
Packit |
6c4009 |
generated += check-cet.out
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|