File: perf-tools-pass-extra_cflags-through-to-libbpf-build-again.patch

package info (click to toggle)
linux 6.12.38-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 1,675,532 kB
  • sloc: ansic: 25,916,840; asm: 269,587; sh: 136,393; python: 65,222; makefile: 55,714; perl: 37,750; xml: 19,284; cpp: 5,894; yacc: 4,927; lex: 2,939; awk: 1,594; sed: 28; ruby: 25
file content (27 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Ben Hutchings <benh@debian.org>
Date: Fri, 16 Aug 2024 15:58:04 +0200
Subject: perf tools: Pass EXTRA_CFLAGS through to libbpf build again

When perf was statically linked to libbpf, any definition of
EXTRA_CFLAGS passed to Makefile.perf propagated to the sub-make of
libbpf.  Since commit 9dabf4003423 ("perf python: Switch module to
linking libraries from building source"), EXTRA_CFLAGS is overridden
to "-fPIC" for the sub-make.

Change to include any user-provided EXTRA_CFLAGS before the "-fPIC"
option.

Fixes: 9dabf4003423 ("perf python: Switch module to linking libraries ...")
Signed-off-by: Ben Hutchings <benh@debian.org>
---
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -951,7 +951,7 @@ $(LIBAPI)-clean:
 $(LIBBPF): FORCE | $(LIBBPF_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBBPF_DIR) FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) \
 		O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= subdir= \
-		EXTRA_CFLAGS="-fPIC" $@ install_headers
+		EXTRA_CFLAGS="$(EXTRA_CFLAGS) -fPIC" $@ install_headers
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)