Skip to content

Commit d8171aa

Browse files
johnhubbardshuahkh
authored andcommitted
selftests/resctrl: fix clang build failure: use LOCAL_HDRS
First of all, in order to build with clang at all, one must first apply Valentin Obst's build fix for LLVM [1]. Once that is done, then when building with clang, via: make LLVM=1 -C tools/testing/selftests ...the following error occurs: clang: error: cannot specify -o when generating multiple output files This is because clang, unlike gcc, won't accept invocations of this form: clang file1.c header2.h Fix this by using selftests/lib.mk facilities for tracking local header file dependencies: add them to LOCAL_HDRS, leaving only the .c files to be passed to the compiler. [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ Fixes: 8e289f4 ("selftests/resctrl: Add resctrl.h into build deps") Cc: Ilpo Järvinen <[email protected]> Signed-off-by: John Hubbard <[email protected]> Acked-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 019baf6 commit d8171aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/selftests/resctrl/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ CFLAGS += $(KHDR_INCLUDES)
55

66
TEST_GEN_PROGS := resctrl_tests
77

8+
LOCAL_HDRS += $(wildcard *.h)
9+
810
include ../lib.mk
911

10-
$(OUTPUT)/resctrl_tests: $(wildcard *.[ch])
12+
$(OUTPUT)/resctrl_tests: $(wildcard *.c)

0 commit comments

Comments
 (0)