]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/resctrl: fix clang build failure: use LOCAL_HDRS
authorJohn Hubbard <jhubbard@nvidia.com>
Fri, 3 May 2024 02:17:12 +0000 (19:17 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 May 2024 19:57:21 +0000 (13:57 -0600)
commitd8171aa4ca72f1a67bf3c14c59441d63c1d2585f
tree2862ffe05874532e1ad107ff8fe08e05df0338eb
parent019baf635eb6ffe8d6c1343f81788f02a7e0ed98
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: 8e289f454289 ("selftests/resctrl: Add resctrl.h into build deps")
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/Makefile