Skip to content

Commit 85c414e

Browse files
committed
Linux build: add an objtool wrapper to filter out the --Werror flag
1 parent 46b82de commit 85c414e

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ AC_CONFIG_FILES([
8686
zfs.release
8787
])
8888

89+
AC_CONFIG_FILES([scripts/objtool-wrapper], [chmod +x scripts/objtool-wrapper])
90+
91+
8992

9093
AC_OUTPUT
9194

module/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ modules-Linux:
5757
$(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \
5858
$(if @KERNEL_CROSS_COMPILE@,CROSS_COMPILE=@KERNEL_CROSS_COMPILE@) \
5959
$(if @KERNEL_ARCH@,ARCH=@KERNEL_ARCH@) \
60+
objtool=@abs_top_srcdir@/scripts/objtool-wrapper \
6061
M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
6162

6263
modules-FreeBSD:

scripts/objtool-wrapper.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# SPDX-License-Identifier: MIT
4+
5+
# Copyright (c) 2025 Attila Füöp <[email protected]>
6+
7+
# Filter out objtools '--Werror' flag.
8+
9+
objtool=@LINUX@/tools/objtool/objtool
10+
args=$(echo "$*" | sed s/--Werror//g)
11+
# echo "wrapper: $objtool $args"
12+
13+
exec "$objtool" $args
14+
15+
# Or use bash: $objtool ${*/--Werror/}
16+

0 commit comments

Comments
 (0)