From: Ian Rogers Date: Tue, 3 Feb 2026 06:09:18 +0000 (-0800) Subject: libperf build: Always place libperf includes first X-Git-Tag: v7.0-rc1~16^2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c5b40678c63be6b85f1c2dc8c8b89d632faf988;p=thirdparty%2Fkernel%2Flinux.git libperf build: Always place libperf includes first When building tools/perf the CFLAGS can contain a directory for the installed headers. As the headers may be being installed while building libperf.a this can cause headers to be partially installed and found in the include path while building an object file for libperf.a. The installed header may reference other installed headers that are missing given the partial nature of the install and then the build fails with a missing header file. Avoid this by ensuring the libperf source headers are always first in the CFLAGS. Fixes: 3143504918105156 ("libperf: Make libperf.a part of the perf build") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 9692d0742ed0e..32301a1d8f0c1 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -50,9 +50,9 @@ INCLUDES = \ -I$(srctree)/tools/include/uapi # Append required CFLAGS +override CFLAGS := $(INCLUDES) $(CFLAGS) override CFLAGS += -g -Werror -Wall override CFLAGS += -fPIC -override CFLAGS += $(INCLUDES) override CFLAGS += -fvisibility=hidden override CFLAGS += $(EXTRA_WARNINGS) override CFLAGS += $(EXTRA_CFLAGS)