Skip to content

Commit 3dfc5eb

Browse files
authored
Merge pull request raspberrypi#872 from YakoYakoYokuYoku/pahole-exclude-rust
scripts: Exclude Rust compilation units with pahole
2 parents 84b0fc2 + dcc5038 commit 3dfc5eb

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

init/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ config RUST
19131913
depends on !MODVERSIONS
19141914
depends on !GCC_PLUGINS
19151915
depends on !RANDSTRUCT
1916-
depends on !DEBUG_INFO_BTF
1916+
depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
19171917
select CONSTRUCTORS
19181918
help
19191919
Enables Rust support in the kernel.

lib/Kconfig.debug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ config PAHOLE_HAS_BTF_TAG
364364
btf_decl_tag) or not. Currently only clang compiler implements
365365
these attributes, so make the config depend on CC_IS_CLANG.
366366

367+
config PAHOLE_HAS_LANG_EXCLUDE
368+
def_bool PAHOLE_VERSION >= 124
369+
help
370+
Support for the --lang_exclude flag which makes pahole exclude
371+
compilation units from the supplied language. Used in Kbuild to
372+
omit Rust CUs which are not supported in version 1.24 of pahole,
373+
otherwise it would emit malformed kernel and module binaries when
374+
using DEBUG_INFO_BTF_MODULES.
375+
367376
config DEBUG_INFO_BTF_MODULES
368377
def_bool y
369378
depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF

scripts/pahole-flags.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ fi
1919
if [ "${pahole_ver}" -ge "122" ]; then
2020
extra_paholeopt="${extra_paholeopt} -j"
2121
fi
22+
if [ "${pahole_ver}" -ge "124" ]; then
23+
# see PAHOLE_HAS_LANG_EXCLUDE
24+
extra_paholeopt="${extra_paholeopt} --lang_exclude=rust"
25+
fi
2226

2327
echo ${extra_paholeopt}

0 commit comments

Comments
 (0)