Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 174034

Summary: dev-lang/tcc chokes on duplicated __i686.get_pc_thunk.bx symbol
Product: Gentoo Linux Reporter: Vincent Pit <gentoo>
Component: [OLD] DevelopmentAssignee: Maintainers for Miscelleneous Language Packages [OBSOLETE] <lang-misc+disabled>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
visibility patch
updated ebuild

Description Vincent Pit 2007-04-10 14:05:25 UTC
Hello,

The symbol __i686.get_pc_thunk.bx, which is present in both libc.a and libc_nonshared.a, is stored in several specimens in libc_nonshared.a. GCC doesn't seem to care, as I didn't encounter any problem with it ; but at least TinyCC croaks on this duplicated symbol and hence refuses to link any program calling atexit().

Regards.

Reproducible: Always

Steps to Reproduce:
nm /usr/lib/libc_nonshared.a | grep "T " | sort | uniq -dc
Actual Results:  
      13 00000000 T __i686.get_pc_thunk.bx

Expected Results:  
      1 00000000 T __i686.get_pc_thunk.bx
Comment 1 Vincent Pit 2007-04-10 14:05:55 UTC
Created attachment 115898 [details]
emerge --info

emerge --info
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-04-10 17:05:40 UTC
Sorry, this is not a glibc bug. See Bug 130831, Comment #9 and following.
Comment 3 Vincent Pit 2007-04-10 19:34:34 UTC
Thank you for your guidance, and sorry for mistargeting the bug. I was surprised to see this symbol duplicated in libc_nonshared because this wasn't the case in my other linux systems.

From the pieces of information available at http://sourceware.org/ml/binutils/2003-03/msg00446.html and http://www.sco.com/developers/gabi/2000-07-17/ch4.symtab.html#visibility, I wrote a patch to set the visibility to the most restrictive one when a duplicate symbol is added, and then to skip it if its visibility is HIDDEN or INTERNAL. This seems to fix the problem.
Comment 4 Vincent Pit 2007-04-10 19:35:17 UTC
Created attachment 115928 [details]
visibility patch
Comment 5 Vincent Pit 2007-04-10 19:36:23 UTC
Created attachment 115929 [details]
updated ebuild
Comment 6 Harald van Dijk (RETIRED) gentoo-dev 2007-04-11 19:47:54 UTC
Thank you for the patch. Have you let upstream know about this, too?
Comment 7 Vincent Pit 2007-04-12 19:32:31 UTC
I posted the bug to their mailing list. They'll do some investigations before considering adding the patch. The discussion should appear soon at http://lists.gnu.org/archive/html/tinycc-devel/2007-04/
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2009-07-10 18:17:38 UTC
Closing, this has been included in 0.9.24 which has been in the tree for quite some time.