Bug#645018: gcc-4.6: build error on REVERSE_CROSS ("gengtype" is wrong arch)
Source: gcc-4.6
Version: 4.6.1-15
Severity: wishlist
Tags: patch
User: crossbuild@debian.org
Usertags: cross
When building in REVERSE_CROSS mode (IE: when trying to build a native
compiler for another architecture with an existing cross-compiler, the
build fails with the following error:
$ apt-get source gcc-4.6=4.6.1-15
$ ( cd gcc-4.6-4.6.1 && dpkg-buildpackage -apowerpcspe -b -us -uc )
[...]
dh_strip -pgcc-4.6-plugin-dev
powerpc-linux-gnuspe-strip: Unable to recognise the format of the input file `debian/gcc-4.6-plugin-dev/usr/lib/gcc/powerpc-linux-gnuspe/4.6/gengtype'
dh_strip: powerpc-linux-gnuspe-strip --remove-section=.comment --remove-section=.note debian/gcc-4.6-plugin-dev/usr/lib/gcc/powerpc-linux-gnuspe/4.6/gengtype returned exit code 1
make[1]: *** [stamps/08-binary-stamp-gcc-plugindev] Error 29
make[1]: Leaving directory `/srv/stuff/toolchain/CROSS/gcc-4.6/gcc-4.6-4.6.1'
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
A brief inspection of the gengtype program shows that it is in fact a
binary built for the build system:
$ file debian/gcc-4.6-plugin-dev/usr/lib/gcc/powerpc-linux-gnuspe/4.6/gengtype
debian/gcc-4.6-plugin-dev/usr/lib/gcc/powerpc-linux-gnuspe/4.6/gengtype: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xfcaf9384cfcf05212c599e6334d7de5bd062c5de, not stripped
As far as I can tell, the "gcc-plugin" support is not supported when
building in REVERSE_CROSS mode and should be disabled.
Please review and apply the attached patch.
Unfortunately, the build still does not complete due to a different
error, one which I will be submitting as an additional followup bug.
Cheers,
Kyle Moffett
--
Curious about my work on the Debian powerpcspe port?
I'm keeping a blog here: http://pureperl.blogspot.com/
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (700, 'testing'), (700, 'stable'), (600, 'unstable'), (500, 'stable-updates'), (500, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -ru gcc-4.6-4.6.1/debian/rules.defs gcc-4.6-4.6.1.new/debian/rules.defs
--- gcc-4.6-4.6.1/debian/rules.defs 2011-10-11 14:55:54.000000000 -0400
+++ gcc-4.6-4.6.1.new/debian/rules.defs 2011-10-11 15:00:43.000000000 -0400
@@ -827,7 +827,11 @@
endif
# plugins --------------------
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
with_plugins := yes
+else
+with_plugins := disabled when cross-compiling
+endif
endif # ifndef DEB_STAGE
Reply to: