From 03feea74dc75397f7eff10a92a322d235a6c1751 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 18 Dec 2024 07:24:38 +0800 Subject: elf: Compile test modules with -fsemantic-interposition Compiler may default to -fno-semantic-interposition. But some elf test modules must be compiled with -fsemantic-interposition to function properly. Add a TEST_CC check for -fsemantic-interposition and use it on elf test modules. This fixed FAIL: elf/tst-dlclose-lazy FAIL: elf/tst-pie1 FAIL: elf/tst-plt-rewrite1 FAIL: elf/unload4 when Clang 19 is used to test glibc. Signed-off-by: H.J. Lu Reviewed-by: Sam James --- elf/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'elf/Makefile') diff --git a/elf/Makefile b/elf/Makefile index b62836d..3c17688 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3293,3 +3293,23 @@ tst-tls22-mod1.so-no-z-defs = yes tst-tls22-mod1-gnu2.so-no-z-defs = yes tst-tls22-mod2.so-no-z-defs = yes tst-tls22-mod2-gnu2.so-no-z-defs = yes + +ifeq ($(have-test-cc-cflags-fsemantic-interposition),yes) +# Compiler may default to -fno-semantic-interposition. These modules +# must be compiled with -fsemantic-interposition. +modules-semantic-interposition = \ + tst-dlclose-lazy-mod1 \ + tst-dlclose-lazy-mod2 \ + tst-piemod1 \ + unload4mod1 \ + unload4mod2 \ + unload4mod3 \ + unload4mod4 \ +# modules-semantic-interposition + +define enable-semantic-interposition +CFLAGS-$(1).c += -fsemantic-interposition +endef +$(foreach m,$(modules-semantic-interposition),\ + $(eval $(call enable-semantic-interposition,$(m)))) +endif -- cgit v1.1