File tree Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,8 @@ LZ4 = lz4c
480
480
XZ = xz
481
481
ZSTD = zstd
482
482
483
+ PAHOLE_FLAGS = $(shell PAHOLE=$(PAHOLE ) $(srctree ) /scripts/pahole-flags.sh)
484
+
483
485
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
484
486
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF )
485
487
NOSTDINC_FLAGS :=
@@ -534,6 +536,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
534
536
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
535
537
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
536
538
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
539
+ export PAHOLE_FLAGS
537
540
538
541
# Files to ignore in find ... statements
539
542
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ quiet_cmd_ld_ko_o = LD [M] $@
40
40
quiet_cmd_btf_ko = BTF [M] $@
41
41
cmd_btf_ko = \
42
42
if [ -f vmlinux ]; then \
43
- LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J --btf_base vmlinux $@; \
43
+ LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \
44
44
$(RESOLVE_BTFIDS) -b vmlinux $@; \
45
45
else \
46
46
printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \
Original file line number Diff line number Diff line change @@ -205,7 +205,6 @@ vmlinux_link()
205
205
gen_btf ()
206
206
{
207
207
local pahole_ver
208
- local extra_paholeopt=
209
208
210
209
if ! [ -x " $( command -v ${PAHOLE} ) " ]; then
211
210
echo >&2 " BTF: ${1} : pahole (${PAHOLE} ) is not available"
@@ -220,16 +219,8 @@ gen_btf()
220
219
221
220
vmlinux_link ${1}
222
221
223
- if [ " ${pahole_ver} " -ge " 118" ] && [ " ${pahole_ver} " -le " 121" ]; then
224
- # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
225
- extra_paholeopt=" ${extra_paholeopt} --skip_encoding_btf_vars"
226
- fi
227
- if [ " ${pahole_ver} " -ge " 121" ]; then
228
- extra_paholeopt=" ${extra_paholeopt} --btf_gen_floats"
229
- fi
230
-
231
222
info " BTF" ${2}
232
- LLVM_OBJCOPY=" ${OBJCOPY} " ${PAHOLE} -J ${extra_paholeopt } ${1}
223
+ LLVM_OBJCOPY=" ${OBJCOPY} " ${PAHOLE} -J ${PAHOLE_FLAGS } ${1}
233
224
234
225
# Create ${2} which contains just .BTF section but no symbols. Add
235
226
# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ # SPDX-License-Identifier: GPL-2.0
3
+
4
+ extra_paholeopt=
5
+
6
+ if ! [ -x " $( command -v ${PAHOLE} ) " ]; then
7
+ return
8
+ fi
9
+
10
+ pahole_ver=$( ${PAHOLE} --version | sed -E ' s/v([0-9]+)\.([0-9]+)/\1\2/' )
11
+
12
+ if [ " ${pahole_ver} " -ge " 118" ] && [ " ${pahole_ver} " -le " 121" ]; then
13
+ # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
14
+ extra_paholeopt=" ${extra_paholeopt} --skip_encoding_btf_vars"
15
+ fi
16
+ if [ " ${pahole_ver} " -ge " 121" ]; then
17
+ extra_paholeopt=" ${extra_paholeopt} --btf_gen_floats"
18
+ fi
19
+
20
+ echo ${extra_paholeopt}
You can’t perform that action at this time.
0 commit comments