Skip to content

Commit a2ac823

Browse files
jason77-wangPaul Walmsley
authored andcommitted
selftests/rseq: Fix a building error for riscv arch
RISC-V rseq selftests include asm/fence.h from tools/arch/riscv, but the rseq Makefile only adds tools/include in the CFLAGS, this results in the building failure both for native and cross build: In file included from rseq.h:131, from rseq.c:37: rseq-riscv.h:11:10: fatal error: asm/fence.h: No such file or directory To fix it, add the matching tools/arch/$(ARCH)/include path in the CFLAGS and derive ARCH from SUBARCH for standalone native builds where ARCH is not set. Fixes: c92786e ("KVM: riscv: selftests: Use the existing RISCV_FENCE macro in `rseq-riscv.h`") Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://patch.msgid.link/20260707082348.36896-1-hui.wang@canonical.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 3fb2949 commit a2ac823

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/testing/selftests/rseq/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ CLANG_FLAGS += -no-integrated-as
55
endif
66

77
top_srcdir = ../../../..
8+
include $(top_srcdir)/scripts/subarch.include
9+
ARCH ?= $(SUBARCH)
10+
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
811

912
CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \
10-
$(CLANG_FLAGS) -I$(top_srcdir)/tools/include
13+
$(CLANG_FLAGS) -I$(top_srcdir)/tools/include \
14+
-I$(LINUX_TOOL_ARCH_INCLUDE)
1115
LDLIBS += -lpthread -ldl
1216

1317
# Own dependencies because we only want to build against 1st prerequisite, but

0 commit comments

Comments
 (0)