Bug#627444: cross-building cpio

2012-04-01 Thread Steve Langasek
Package: cpio
Version: 2.11-7
Followup-For: Bug #627444
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu precise ubuntu-patch

Hi there,

Here is an additional fix that's useful for cross-building.  Currently the
'strip' command included in binutils (i.e., provided by build-essential)
only understands executables of the build architecture.  I presume that when
Steve did his cross-build test with cpio, he had binutils-multiarch
installed, which provides a 'strip' command that supports all known object
formats.

Since binutils-multiarch is redundant when you already have a
cross-toolchain installed on the system, and since it's not actually
guaranteed that the binutils-multiarch in the archive understands the object
format of the architecture you're cross-compiling for, it's better to simply
use the strip that's provided by the cross-binutils.

The attached patch implements this.  Please consider applying it along with
the previous patch from Steve.

For reference, both patches have been applied to cpio in Ubuntu.

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
=== modified file 'debian/rules'
--- debian/rules	2011-01-18 12:22:07 +
+++ debian/rules	2012-04-01 18:06:49 +
@@ -13,8 +13,10 @@
 DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
 CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+STRIP = $(DEB_HOST_GNU_TYPE)-strip
 else
 CROSS= --build $(DEB_BUILD_GNU_TYPE)
+STRIP = strip
 endif
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -114,7 +116,7 @@
 	  debian/tmp/usr/share/man/man1/mt-gnu.1
 # Strip binaries (including hack by policy wonks)
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	strip -R.note -R.comment debian/tmp/bin/*
+	$(STRIP) -R.note -R.comment debian/tmp/bin/*
 endif
 	rm -rf debian/tmp/usr/sbin
 # Install documentation




signature.asc
Description: Digital signature


Bug#627444: cross-building cpio

2011-07-20 Thread Loïc Minier
On Fri, May 20, 2011, Steve McIntyre wrote:
 -#ifndef __WIN32__
 +#ifndef lstat
  int lstat ();
 +#endif
 +#ifndef stat
  int stat ();
  #endif

 This does have the effect of defining stat and lstat when __WIN32__ is
 defined, which might not be desired (perhaps it's preferred to fail the
 WIN32 build earlier if the code tries to use stat or lstat when it
 shouldn't).  I guess only the upstream developers can tell their
 preference here though.

-- 
Loïc Minier



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#627444: cross-building cpio

2011-05-20 Thread Steve McIntyre
Package: cpio
Version: 2.11-7
Tags: patch

Hi,

I'm currently working on cross-building bits of Debian while
bootstrapping the armhf port. cpio fails to cross-build because of an
invalid redefinition of stat() during the compile. It's not 100% clear
why this only triggers on a cross-build, but this patch makes it work
for me.

--- cpio/src/filetypes.h~   2011-05-05 17:37:25.0 +
+++ cpio/src/filetypes.h2011-05-20 16:40:09.559486468 +
@@ -82,7 +82,9 @@
 #define lstat stat
 #endif
 
-#ifndef __WIN32__
+#ifndef lstat
 int lstat ();
+#endif
+#ifndef stat
 int stat ();
 #endif

Cheers,
-- 
Steve McIntyre
steve.mcint...@linaro.org




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org