|
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 Service |
8bbac7 |
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 |
8bbac7 |
ifeq ($(enable-cet),yes)
|
|
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 |
8bbac7 |
tst-cet-legacy-3 tst-cet-legacy-4
|
|
Packit |
6c4009 |
ifneq (no,$(have-tunables))
|
|
Packit Service |
8bbac7 |
tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
|
|
Packit Service |
8bbac7 |
tst-cet-legacy-mod-4
|
|
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 |
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 |
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 |
8bbac7 |
tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.tune.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 |
8bbac7 |
tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.tune.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 |
8bbac7 |
tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.tune.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
|