From 20c894d21eb64153abf7c7f96e6a151897cf1488 Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Fri, 17 Mar 2023 10:17:28 +0100 Subject: Exclude routines from fortification Since the _FORTIFY_SOURCE feature uses some routines of Glibc, they need to be excluded from the fortification. On top of that: - some tests explicitly verify that some level of fortification works appropriately, we therefore shouldn't modify the level set for them. - some objects need to be build with optimization disabled, which prevents _FORTIFY_SOURCE to be used for them. Assembler files that implement architecture specific versions of the fortified routines were not excluded from _FORTIFY_SOURCE as there is no C header included that would impact their behavior. Reviewed-by: Siddhesh Poyarekar --- posix/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'posix') diff --git a/posix/Makefile b/posix/Makefile index ad43cbdec6..5113ee3b74 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -183,6 +183,14 @@ routines := \ wordexp \ # routines +# Exclude fortified routines from being built with _FORTIFY_SOURCE +routines_no_fortify += \ + confstr \ + getgroups \ + pread \ + pread64 \ + # routines_no_fortify + aux := \ environ \ init-posix \ @@ -604,6 +612,9 @@ bug-glob1-ARGS = "$(objpfx)" tst-execvp3-ARGS = --test-dir=$(objpfx) CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\" +# Test voluntarily overflows struct dirent +CFLAGS-bug-glob2.c += $(no-fortify-source) + $(objpfx)testcases.h: TESTS TESTS2C.sed LC_ALL=C sed -f TESTS2C.sed < $< > $@T mv $@T $@ -- cgit 1.4.1