diff mbox series

[2/8] selftests: x86: check_initial_reg_state: remove -no-pie while using -static

Message ID 20240501122918.3831734-3-usama.anjum@collabora.com
State New
Headers show
Series selftests: x86: build suite with clang | expand

Commit Message

Muhammad Usama Anjum May 1, 2024, 12:29 p.m. UTC
The -static clang flag ignores -no-pie flag. Hence following warning is
generated. Fix the warning by removing the -no-pie flag before
specifying -static flag.

clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 tools/testing/selftests/x86/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 671b1819694ff..b0f5b5ff79b8d 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -108,8 +108,9 @@  $(OUTPUT)/test_syscall_vdso_32: thunks_32.S
 # check_initial_reg_state is special: it needs a custom entry, and it
 # needs to be static so that its interpreter doesn't destroy its initial
 # state.
-$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static
-$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static
+CFLAGS2:=$(filter-out -no-pie,$(CFLAGS))
+$(OUTPUT)/check_initial_reg_state_32: CFLAGS2 += -Wl,-ereal_start -static
+$(OUTPUT)/check_initial_reg_state_64: CFLAGS2 += -Wl,-ereal_start -static
 
 $(OUTPUT)/nx_stack_32: CFLAGS += -Wl,-z,noexecstack
 $(OUTPUT)/nx_stack_64: CFLAGS += -Wl,-z,noexecstack