Skip to contentSkip to conversation

deb-pkg: Apply $(CROSS_COMPILE) when calling objcopy

PATCH In review Ian Campbell 3 participants 4 messages Jun 2, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 deb-pkg: Apply $(CROSS_COMPILE) when calling objcopy

Allows me to cross build an armhf package from amd64.

---
 scripts/package/builddeb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/package/builddeb +3 -3
index f46e4dd..c22ab79 100644
@@ -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
+				${CROSS_COMPILE}objcopy --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
 				# strip original module from debug symbols
-				objcopy --strip-debug $module
+				${CROSS_COMPILE}objcopy --strip-debug $module
 				# then add a link to those
-				objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+				${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
 			done
 		)
 	fi
Signature · 1 line
1.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Ian Campbell

Allows me to cross build an armhf package from amd64.

Quoted 32 lines
---
 scripts/package/builddeb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/package/builddeb +3 -3
index f46e4dd..c22ab79 100644
@@ -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
+				${CROSS_COMPILE}objcopy --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
 				# strip original module from debug symbols
-				objcopy --strip-debug $module
+				${CROSS_COMPILE}objcopy --strip-debug $module
 				# then add a link to those
-				objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+				${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
 			done
 		)
 	fi
Signature · 7 lines
1.9.0


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]
#2 lore raw
In reply to Ian Campbell
Quoted 27 lines · Ian Campbell

Allows me to cross build an armhf package from amd64.

---
 scripts/package/builddeb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/package/builddeb +3 -4
index f46e4dd..c22ab79 100644
@@ -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
+                               ${CROSS_COMPILE}objcopy --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
                                # strip original module from debug symbols
-                               objcopy --strip-debug $module
+                               ${CROSS_COMPILE}objcopy --strip-debug $module
                                # then add a link to those
-                               objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+                               ${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
                        done
                )
        fi
--
Quoted 1 line

1.9.0

I submitted it a month ago. It's already applied to kbuild.git#misc:
http://www.spinics.net/lists/linux-kbuild/msg09273.html