Skip to content

Commit bfb713e

Browse files
james-c-linaronamhyung
authored andcommitted
perf tools: Fix arm64 build by generating unistd_64.h
Since pulling in the kernel changes in commit 22f7208 ("tools headers: Update the syscall table with the kernel sources"), arm64 is no longer using a generic syscall header and generates one from the syscall table. Therefore we must also generate the syscall header for arm64 before building Perf. Add it as a dependency to libperf which uses one syscall number. Perf uses more, but as libperf is a dependency of Perf it will be generated for both. Future platforms that need this will have to add their own syscall-y targets in libperf manually. Unfortunately the arch specific files that do this (e.g. arch/arm64/include/asm/Kbuild) can't easily be imported into the Perf build. But Perf only needs a subset of the generated files anyway, so redefining them is probably the correct thing to do. Fixes: 22f7208 ("tools headers: Update the syscall table with the kernel sources") Signed-off-by: James Clark <[email protected]> Tested-by: Harshit Mogalapalli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 9c32cda commit bfb713e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tools/lib/perf/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
4242
TEST_ARGS := $(if $(V),-v)
4343

4444
INCLUDES = \
45+
-I$(OUTPUT)/../arch/$(SRCARCH)/include/generated/uapi \
4546
-I$(srctree)/tools/lib/perf/include \
4647
-I$(srctree)/tools/lib/ \
4748
-I$(srctree)/tools/include \
@@ -99,7 +100,16 @@ $(LIBAPI)-clean:
99100
$(call QUIET_CLEAN, libapi)
100101
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
101102

102-
$(LIBPERF_IN): FORCE
103+
uapi-asm := $(OUTPUT)/../arch/$(SRCARCH)/include/generated/uapi/asm
104+
ifeq ($(SRCARCH),arm64)
105+
syscall-y := $(uapi-asm)/unistd_64.h
106+
endif
107+
uapi-asm-generic:
108+
$(if $(syscall-y),\
109+
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-headers obj=$(uapi-asm) \
110+
generic=include/uapi/asm-generic $(syscall-y),)
111+
112+
$(LIBPERF_IN): uapi-asm-generic FORCE
103113
$(Q)$(MAKE) $(build)=libperf
104114

105115
$(LIBPERF_A): $(LIBPERF_IN)

tools/perf/Makefile.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ include $(srctree)/tools/scripts/Makefile.arch
2929
$(call detected_var,SRCARCH)
3030

3131
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated
32+
CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated/uapi
3233

3334
# Additional ARCH settings for ppc
3435
ifeq ($(SRCARCH),powerpc)

0 commit comments

Comments
 (0)