From: Matt Turner Date: Mon, 10 Aug 2026 19:09:09 +0000 (-0400) Subject: elf: build the IFUNC resolver stack protector tests only with ssp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6f3cc4246a86279ca963b589b8dc9dd15714cda;p=thirdparty%2Fglibc.git elf: build the IFUNC resolver stack protector tests only with ssp The three resolver translation units are compiled with -fstack-protector-all so that the canary code is emitted whatever the default is. A target whose compiler has no stack protector at all cannot do that, and on alpha the build stopped: cc1: error: '-fstack-protector' not supported for this target [-Werror] taking the rest of the elf tests with it. Guard the tests on $(have-ssp), which configure already sets from the compiler's own answer. That is the answer for -fstack-protector rather than for -fstack-protector-all, which has its own configure test, but only the former reaches config.make, and a compiler that has one has the other. Reviewed-by: Adhemerval Zanella --- diff --git a/elf/Makefile b/elf/Makefile index d279a5135c..dbc6cfec7f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -292,7 +292,7 @@ tests-static-internal := \ tst-tunables-enable_secure \ # tests-static-internal -ifeq (yes,$(have-gcc-ifunc)) +ifeq (yesyes,$(have-gcc-ifunc)$(have-ssp)) tests-static-internal += \ tst-ifunc-resolver-protector-static \ tst-ifunc-resolver-protector-static-non-pie \ @@ -777,7 +777,7 @@ test-extras += \ tst-tlsmod18a \ # test-extras -ifeq (yes,$(have-gcc-ifunc)) +ifeq (yesyes,$(have-gcc-ifunc)$(have-ssp)) # The resolver helper needs for the TCB-canary STACK_CHK_GUARD # macro, so it must be compiled with MODULE_NAME=testsuite_internal. extra-test-objs += \ @@ -1318,7 +1318,6 @@ tests += \ tst-ifunc-plt-bindnow \ tst-ifunc-plt-dlopen \ tst-ifunc-plt-dlopen-bindnow \ - tst-ifunc-resolver-protector \ tst-ifunc-tls-init \ tst-ifunc-tls-init-gd-ld \ tst-ifunc-tls-write \ @@ -1387,7 +1386,6 @@ modules-names += \ ifuncmod6 \ tst-ifunc-plt-dep \ tst-ifunc-plt-lib \ - tst-ifunc-resolver-protector-mod \ tst-ifunc-tls-init-gd-global-lib \ tst-ifunc-tls-init-gd-lib \ tst-ifunc-tls-init-ld-lib \ @@ -1412,6 +1410,10 @@ endif ifeq (no,$(with-lld)) modules-names += ifuncmod5 endif +ifeq ($(have-ssp),yes) +tests += tst-ifunc-resolver-protector +modules-names += tst-ifunc-resolver-protector-mod +endif endif endif