Skip to content

Commit a89e589

Browse files
johnhubbardshuahkh
authored andcommitted
selftests/x86: avoid -no-pie warnings from clang during compilation
When building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang warns that -no-pie is "unused during compilation". This occurs because clang only wants to see -no-pie during linking. Here, we don't have a separate linking stage, so a compiler warning is unavoidable without (wastefully) restructuring the Makefile. Avoid the warning by simply disabling that warning, for clang builds. Acked-by: Muhammad Usama Anjum <[email protected]> Signed-off-by: John Hubbard <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 2ab9c93 commit a89e589

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/testing/selftests/x86/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
4040
# call32_from_64 in thunks.S uses absolute addresses.
4141
ifeq ($(CAN_BUILD_WITH_NOPIE),1)
4242
CFLAGS += -no-pie
43+
44+
ifneq ($(LLVM),)
45+
# clang only wants to see -no-pie during linking. Here, we don't have a separate
46+
# linking stage, so a compiler warning is unavoidable without (wastefully)
47+
# restructuring the Makefile. Avoid this by simply disabling that warning.
48+
CFLAGS += -Wno-unused-command-line-argument
49+
endif
4350
endif
4451

4552
define gen-target-rule-32

0 commit comments

Comments
 (0)