Skip to content

Commit

Permalink
builddeb: use $OBJCOPY variable instead of objcopy
Browse files Browse the repository at this point in the history
In cross-build environment, we expect to use the cross-compiler objcopy
instead of the host objcopy.

It fixes following build failures:
objcopy --only-keep-debug lib/modules/3.14/kernel/net/ipv6/xfrm6_mode_tunnel.ko /srv/build/linux/debian/dbgtmp/usr/lib/debug/lib/modules/3.14/kernel/net/ipv6/xfrm6_mode_tunnel.ko
objcopy: Unable to recognise the format of the input file `lib/modules/3.14/kernel/net/ipv6/xfrm6_mode_tunnel.ko'

Signed-off-by: Fathi Boudra <[email protected]>
Cc: stable <[email protected]> # 3.12+
Fixes: 810e843 ('deb-pkg: split debug symbols in their own package')
Reviewed-by: Ben Hutchings <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
fboudra authored and michal42 committed Apr 24, 2014
1 parent 8c38a53 commit 6b4a144
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
for module in $(find lib/modules/ -name *.ko); do
mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
# only keep debug symbols in the debug file
objcopy --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
# strip original module from debug symbols
objcopy --strip-debug $module
$OBJCOPY --strip-debug $module
# then add a link to those
objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
done
)
fi
Expand Down

0 comments on commit 6b4a144

Please sign in to comment.