Enabling of all possible targets broke ARM cross toolchain

Bug #726428 reported by Marcin Juszkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Fix Released
Medium
Loïc Minier

Bug Description

Binary package hint: binutils

Binutils 2.21.0.20110216-1ubuntu2 got "--enable-targets=all" for binutils-multiarch build. This was probably done to get rid of a need to build cross binutils but broke ARM one badly:

10:44 hrw@home:tmp$ arm-linux-gnueabi-gcc hello.c
10:45 hrw@home:tmp$ strip a.out
strip:a.out: File format is ambiguous
strip: Matching formats: elf32-littlearm elf32-littlearm-symbian elf32-littlearm-vxworks
10:46 hrw@home:tmp$ file a.out
a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

Since then I am unable to upload fixed ARM cross toolchain into archive due to same break:

dh_strip -plibgcc1-armel-cross --dbg-package=libgcc1-dbg-armel-cross
dh_strip debug symbol extraction: all non-arch-all packages for this build platform amd64: gcc-4.5-arm-linux-gnueabi-base gcc-4.5-arm-linux-gnueabi gcc-4.5-plugin-dev-arm-linux-gnueabi gcc-4.5-hppa64 cpp-4.5-arm-linux-gnueabi
dh_strip debug symbol extraction: not adding gnu debuglinks since --dbg-package is given
dh_strip debug symbol extraction: packages to act on:
dh_strip debug symbol extraction: ignored packages:
objcopy:debian/libgcc1-armel-cross/usr/arm-linux-gnueabi/lib/libgcc_s.so.1: File format is ambiguous
objcopy: Matching formats: elf32-littlearm elf32-littlearm-symbian elf32-littlearm-vxworks
dh_strip.pkg-create-dbgsym: objcopy --only-keep-debug debian/libgcc1-armel-cross/usr/arm-linux-gnueabi/lib/libgcc_s.so.1 debian/libgcc1-dbg-armel-cross/usr/lib/debug//usr/arm-linux-gnueabi/lib/libgcc_s.so.1 returned exit code 1

Related branches

Revision history for this message
Loïc Minier (lool) wrote :

Thanks for the report

I think it's inconvenient that objcopy has this behavior, and it does probably make sense to change it to not list all ARM architectures. That said, it seems like the above build calls dh_strip on an armel-cross architecture all package, which is not too common, and also calls it as a regular build instead of a cross-build which means that the hosts' strip gets called instead of the cross-strip.

It's probably a good idea to call dh_strip here as armel-cross_all packages are a bit special, but probably this should be called with dpkg-architecture args set to a cross build.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

18:17 < hrw> slangasek: dh_strip checks for DEB_BUILD_GNU_TYPE/DEB_HOST_GNU_TYPE when it tries to find cross tools and it is ok. but for cross-gcc it is only partially good as we generate both host binaries (dh-strip is fine) and cross ones (dh-strip fails)
18:17 < slangasek> hrw: right
18:18 < hrw> I think that we can change gcc to manually strip using cross-strip for cross builds but would it be proper way?
18:19 < slangasek> hrw: lool seems to have thoughts about what dh_strip should do here; I think he has a point that if you're running dh_strip on an arch: all package, you probably want the binutils-multiarch version
18:20 < steev> i ask about it being a mirror because i can't seem to check out Freescale's repo currently
18:20 < hrw> slangasek: but for strip-multiarch I need to know what I will strip cause now it just fail
18:21 < slangasek> hrw: well, I don't think gcc manually using the cross-strip sounds very correct. what other options are there? Can we revert these latest changes to binutils-multiarch?
18:22 < hrw> slangasek: that would be simplest solution I think
18:22 < hrw> we can look at returning to it during 11.10
18:37 < hrw> slangasek: DEB_HOST_GNU_TYPE=arm-linux-gnueabi dh_strip -plibgcc1-armel-cross --dbg-package=libgcc1-dbg-armel-cross
18:37 < hrw> slangasek: that works and is change into gcc packaging to set DEB_HOST_GNU_TYPE=DEB_TARGET_GNU_TYPE
18:38 < hrw> slangasek: arm-linux-gnueabi-objcopy --only-keep-debug debian/libgcc1-armel-cross/usr/arm-linux-gnueabi/lib/libgcc_s.so.1 debian/libgcc1-dbg-armel-cross/usr/lib/debug//usr/arm-linux-gnueabi/lib/libgcc_s.so.1

Thats added to not forget about it. Change was done to gcc/debian/rules.d/binary-libgcc.mk packaging rules.

Loïc Minier (lool)
Changed in binutils (Ubuntu):
assignee: nobody → Loïc Minier (lool)
Loïc Minier (lool)
Changed in binutils (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.21.0.20110216-1ubuntu3

---------------
binutils (2.21.0.20110216-1ubuntu3) natty; urgency=low

  * Read multiarch targets from the first column of /usr/share/dpkg/archtable;
    it's not the ideal list, but it's better than a hardcoded list and
    enabling all targets was breaking too many tools; LP: #726428.
 -- Loic Minier <email address hidden> Wed, 02 Mar 2011 18:57:13 +0100

Changed in binutils (Ubuntu):
status: In Progress → Fix Released
tags: added: multiarch-followup
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.