selftests/nolibc: use the configured kernel header directory
Subsystems (2)
PATCH 1/1 selftests/nolibc: use the configured kernel header directory
The freestanding build hardcodes the source tree's usr/include even when selftests exports KHDR_INCLUDES for an output-directory build. Use the exported header location while preserving -nostdlib, -nostdinc and static linkage. GCC 14 and Clang 21 builds then find the generated UAPI headers.
Fixes eb1353110831 ("selftests/nolibc: integrate with kselftests")
Signed-off-by Sasha Levin <[email protected]>
--- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/nolibc/Makefile +1 -1
@@ -10,7 +10,7 @@ cc-option = $(call __cc-option, $(CC),,$(1),$(2)) include Makefile.include $(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \ - -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \ + -isystem $(top_srcdir)/tools/include/nolibc $(KHDR_INCLUDES) \ $(CFLAGS_NOLIBC_TEST) $(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc) $(OUTPUT)/nolibc-test: $(NOLIBC_TEST_SOURCES) | headers
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
Signature · 1 line
2.53.0
Quoted 10 lines · Sasha Levin
The freestanding build hardcodes the source tree's usr/include even when selftests exports
KHDR_INCLUDESfor an output-directory build. Use the exported header location while preserving -nostdlib, -nostdinc and static linkage. GCC 14 and Clang 21 builds then find the generated UAPI headers.Fixes eb1353110831 ("selftests/nolibc: integrate with kselftests")Signed-off-by Sasha Levin <[email protected]>--- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks!
(...)