diff options
| author | James Clark <james.clark@linaro.org> | 2025-03-19 11:40:09 +0000 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:20:30 -0500 |
| commit | 5cf6e76e4f4fee54c0056758b639cf4919cffba9 (patch) | |
| tree | 7ac7c9c0bd0291277e80356767c98c53b3048e67 /tools/lib/perf | |
| parent | 66e9b70c64dfe795acf300eafadd3442f940561f (diff) | |
| download | linux-5cf6e76e4f4fee54c0056758b639cf4919cffba9.tar.gz linux-5cf6e76e4f4fee54c0056758b639cf4919cffba9.tar.bz2 linux-5cf6e76e4f4fee54c0056758b639cf4919cffba9.zip | |
libperf: Don't remove -g when EXTRA_CFLAGS are used
[ Upstream commit f5b07010c13c77541e8ade167d05bef3b8a63739 ]
When using EXTRA_CFLAGS, for example "EXTRA_CFLAGS=-DREFCNT_CHECKING=1",
this construct stops setting -g which you'd expect would not be affected
by adding extra flags. Additionally, EXTRA_CFLAGS should be the last
thing to be appended so that it can be used to undo any defaults. And no
condition is required, just += appends to any existing CFLAGS and also
appends or doesn't append EXTRA_CFLAGS if they are or aren't set.
It's not clear why DEBUG=1 is required for -g in Perf when in libperf
it's always on, but I don't think we need to change that behavior now
because someone may be depending on it.
Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250319114009.417865-1-james.clark@linaro.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 8c5b40678c63 ("libperf build: Always place libperf includes first")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/lib/perf')
| -rw-r--r-- | tools/lib/perf/Makefile | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 3a9b2140aa04..478fe57bf8ce 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -54,13 +54,6 @@ endif TEST_ARGS := $(if $(V),-v) -# Set compile option CFLAGS -ifdef EXTRA_CFLAGS - CFLAGS := $(EXTRA_CFLAGS) -else - CFLAGS := -g -Wall -endif - INCLUDES = \ -I$(srctree)/tools/lib/perf/include \ -I$(srctree)/tools/lib/ \ @@ -70,11 +63,12 @@ INCLUDES = \ -I$(srctree)/tools/include/uapi # Append required CFLAGS -override CFLAGS += $(EXTRA_WARNINGS) -override CFLAGS += -Werror -Wall +override CFLAGS += -g -Werror -Wall override CFLAGS += -fPIC override CFLAGS += $(INCLUDES) override CFLAGS += -fvisibility=hidden +override CFLAGS += $(EXTRA_WARNINGS) +override CFLAGS += $(EXTRA_CFLAGS) all: |
