Linaro GCC packages don't by default use %gnu_unique_object

Bug #949805 reported by Alexandros Frantzis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
High
Ramana Radhakrishnan
4.6
Fix Released
High
Ramana Radhakrishnan
4.7
Fix Released
High
Ramana Radhakrishnan
gcc-4.6 (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

The example code at http://people.linaro.org/~afrantzis/cpp_unique_global.tar.gz (make; LD_LIBRARY_PATH=. ./main), outputs the same address twice on x86_64, but two different addresses (i.e. there are two different objects) on armhf. On x86_64 the symbol A<int>::a in each .so file is 'u':'unique global', on armhf it is 'w':'weak'. This problem breaks compiz/unity on ARM.

Quoting from Ramana's post in the linaro-toolchain mailing list:

I suspect this is a compiler bug around the handling of STB_GNU_UNIQUE_OBJECT- something I suspect was invented to solve the problem in this space - it should all just work in the GNU/Linux world.

The assembler files on x86_64 from the small testcase have

 .type _ZN1AIiE1aE, @gnu_unique_object

while the one in case of ARM doesn't have this.

However my suspicion about the problem is around the fact that GCC in it's build proces emits .type x, @gnu_unique_object to check whether this feature is supported by the GNU assembler. Historically `@' has been a comment character on ARM . So, the compiler doesn't know that GNU_UNIQUE_OBJECT is supported in the assembler and it all falls apart very quickly after that and therefore doesn't generate such code ...

The quickest workaround IMHO is for a new compiler build that is rebuilt with --enable-gnu-unique-object. Given this feature went into a not very recent version of binutils, I would expect most recent assemblers to support this feature and for this to just work (TM). I would expect this configure option to be turned on for cross-compilers as well. It might also be the fastest way of testing this feature.

summary: - Linaro GCC packages don't support %gnu_unique_object on ARM
+ Linaro GCC packages don't by default use %gnu_unique_object
Changed in gcc-linaro:
assignee: nobody → Ramana Radhakrishnan (ramana)
Revision history for this message
Matthias Klose (doko) wrote :

affects ARM only

Changed in gcc-4.6 (Ubuntu Precise):
importance: Undecided → High
milestone: none → ubuntu-12.04-beta-2
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.6 - 4.6.3-1ubuntu3

---------------
gcc-4.6 (4.6.3-1ubuntu3) precise; urgency=low

  * Drop the 4.6.2 symlink.
  * Always configure with --enable-gnu-unique-object. LP: #949805.
  * Fix ARM ABI conformance regression, taken from trunk/Linaro.
 -- Matthias Klose <email address hidden> Thu, 08 Mar 2012 23:01:13 +0100

Changed in gcc-4.6 (Ubuntu Precise):
status: Confirmed → Fix Released
Michael Hope (michaelh1)
Changed in gcc-linaro:
status: New → Triaged
importance: Undecided → High
milestone: none → 4.7-2012.04
status: Triaged → In Progress
Michael Hope (michaelh1)
Changed in gcc-linaro:
milestone: 4.7-2012.04 → 4.7-2012.05
no longer affects: gcc-linaro/4.6
Michael Hope (michaelh1)
Changed in gcc-linaro:
milestone: 4.7-2012.05 → 4.7-2012.06
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.