Skip to contentSkip to conversation

rseq selftests: Fix: use KHDR_INCLUDES for kernel headers

RFC PATCH New Mathieu Desnoyers 1 participant 2 messages Jan 16, 2023

Subsystems (3)
lore
Share & tools
lore

Mathieu Desnoyers

author maintainer
#0 lore raw

RFC PATCH 1/2 rseq selftests: Fix: use KHDR_INCLUDES for kernel headers

Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).

---
 tools/testing/selftests/rseq/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/Makefile +1 -1
index 82a52810a649..b357ba24af06 100644
@@ -4,7 +4,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
 CLANG_FLAGS += -no-integrated-as
 endif
 
-CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \
+CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \
 	  $(CLANG_FLAGS)
 LDLIBS += -lpthread -ldl
 
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

RFC PATCH 2/2 sched/membarrier selftests: Fix: use KHDR_INCLUDES for kernel headers

Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).

---
 tools/testing/selftests/membarrier/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/membarrier/Makefile +1 -1
index 34d1c81a2324..fc840e06ff56 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-CFLAGS += -g -I../../../../usr/include/
+CFLAGS += -g $(KHDR_INCLUDES)
 LDLIBS += -lpthread
 
 TEST_GEN_PROGS := membarrier_test_single_thread \
Signature · 1 line
2.25.1