File tree 2 files changed +24
-3
lines changed
2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,12 @@ quiet_cmd_ld_ko_o = LD [M] $@
39
39
40
40
quiet_cmd_btf_ko = BTF [M] $@
41
41
cmd_btf_ko = \
42
- if [ -f vmlinux ]; then \
43
- LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J --btf_base vmlinux $@; \
44
- else \
42
+ if [ ! -f vmlinux ]; then \
45
43
printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \
44
+ elif $(srctree)/scripts/is_rust_module.sh $@; then \
45
+ printf "Skipping BTF generation for %s because it's a Rust module\n" $@ 1>&2; \
46
+ else \
47
+ LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J --btf_base vmlinux $@; \
46
48
fi;
47
49
48
50
# Same as newer-prereqs, but allows to exclude specified extra dependencies
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # is_rust_module.sh MOD.ko
5
+ #
6
+ # Returns 0 if MOD.ko is a rust module, 1 otherwise.
7
+
8
+ set -e
9
+ module=" $* "
10
+
11
+ while IFS= read -r line
12
+ do
13
+ # Any symbol beginning with "_R" is a v0 mangled rust symbol
14
+ if [[ $line =~ ^[0-9a-fA-F]+[[:space:]]+[uUtTrR][[:space:]]+_R[^[:space:]]+$ ]]; then
15
+ exit 0
16
+ fi
17
+ done < < (nm " $module " )
18
+
19
+ exit 1
You can’t perform that action at this time.
0 commit comments