W dniu 29.08.2012 18:39, Wookey pisze:
> If binutils is cross-built, using
> DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -aarmhf -uc -us
>
> This results in install failing because 'install' is run with
> --strip-program="arm-linux-gnueabihf-strip --remove-section=.comment
> --remove-section=.note"
> which of course results in 'file not found', because --strip-program is
> expecting an
> actual binary name.
> This works on the native build because
> install_binary = install -m 755 -s
> i.e. does not include the --strip-program setting.
>
> There is no --strip-options setting in install so far as I can see, so if
> this behvaiour
> is important then I think it can only be done with a wrapper script.
Attached patch fixes strip problem and also changes debian/control
handling to make sure that proper file is generated for cross builds.
diff -Naur /usr/src/binutils/debian/rules debian/rules
--- /usr/src/binutils/debian/rules 2012-08-22 16:16:16.000000000 +0200
+++ debian/rules 2012-08-31 14:18:33.770224213 +0200
@@ -105,7 +105,8 @@
CROSS := $(DEB_HOST_GNU_TYPE)-
CC = $(CROSS)gcc
CXX = $(CROSS)g++
- STRIP= $(CROSS)strip --remove-section=.comment --remove-section=.note
+ STRIP= $(CURDIR)/debian/strip.cross
+ #$(CROSS)strip --remove-section=.comment --remove-section=.note
install_binary = install -m 755 -s --strip-program="$(STRIP)"
endif
@@ -311,9 +312,12 @@
-rm -rf debian/patched debian/tmp debian/files* debian/substvars
-rm -f debian/*.orig debian/*.rej
-rm -rf $(d_cross) debian/files debian/substvars
- -rm -rf builddir-$(TARGET) {configure,build,install}-cross-stamp
+ -rm -rf builddir-$(TARGET) {configure,build,install}-cross-stamp ontrol-stamp
+ -rm -rf debian/strip.cross
+ cp debian/control.in debian/control
for i in debian/*.in; do \
case "$$i" in debian/control*.in) continue; esac; \
+ case "$$i" in debian/strip.cross.in) continue; esac; \
rm -f $${i%*.in}; \
done
@@ -321,7 +325,7 @@
################################################################################
-debian/control: debian/control.in $(if $(TARGET),debian/control.cross.in)
+control-stamp: debian/control.in $(if $(TARGET),debian/control.cross.in)
ifneq (,$(TARGET))
sed "/^$$/ q" < debian/control.in > debian/control
sed -e "s/__TARGET__/$$(echo -n $(TARGET) | sed s/_/-/g)/" \
@@ -329,6 +333,12 @@
else
cp debian/control.in debian/control
endif
+ifneq (,$(CROSS))
+ sed -e "s/__TARGET__/$$(echo -n $(CROSS) | sed s/_/-/g)/" \
+ < debian/strip.cross.in >> debian/strip.cross
+ chmod 755 debian/strip.cross
+endif
+ touch $@
#######################
# single-arch targets #
@@ -339,7 +349,7 @@
SINGLE_CONFARGS += --enable-ld=default --enable-gold
endif
-configure-single-stamp: patch-stamp debian/control
+configure-single-stamp: patch-stamp control-stamp
$(checkdir)
ifeq ($(with_check),yes)
@@ -919,7 +929,6 @@
dpkg --build $(d_cross) ..
else
- cp debian/control.in debian/control
: # generate some control & helper files
nver=$$(echo $(DEB_UPSTREAM) | awk -F. '{ OFS="."; $$NF=$$NF+1; print }'); \
for i in debian/*.in; do \
@@ -1191,7 +1200,7 @@
CONFARGS += --enable-ld=default --enable-gold
endif
-configure-cross-stamp: patch-stamp debian/control
+configure-cross-stamp: patch-stamp control-stamp
$(checkdir)
test "" != "$(TARGET)"
rm -rf configure-cross-stamp builddir-$(TARGET)
diff -Naur /usr/src/binutils/debian/strip.cross.in debian/strip.cross.in
--- /usr/src/binutils/debian/strip.cross.in 1970-01-01 01:00:00.000000000 +0100
+++ debian/strip.cross.in 2012-08-31 13:27:28.766166672 +0200
@@ -0,0 +1 @@
+__TARGET__strip --remove-section=.commend --remove-section=.note $*