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

Bug 187455

Summary: gcc appears to be generating unlinkable code w/ -fprofile-arcs
Product: Gentoo Linux Reporter: M. Edward Borasky <znmeb>
Component: New packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal CC: znmeb
Priority: High    
Version: 2007.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description M. Edward Borasky 2007-08-02 03:47:27 UTC
I am attempting to profile the development branch of Ruby (1.9) using gcc 4.2.0. The compile flags are

gcc -g -fprofile-arcs

It gets through all the compiles fine, but the final link step crashes like this:

gcc -g -fprofile-arcs  -fPIC  -L.  -rdynamic -Wl,-export-dynamic   main.o  -Wl,-R -Wl,/var/ruby-core/install/lib -L/var/ruby-core/install/lib -lruby -lpthread -ldl -lcrypt -lm   -o ruby
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ruby: hidden symbol `__gcov_execv' in /usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/libgcov.a(_gcov_execv.o) is referenced by DSO
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [ruby] Error 1
make[1]: Leaving directory `/var/ruby-core/build'
make: *** [all] Error 2


The whole thing works fine if I take off the "-fprofile-arcs" flag, so I'm pretty sure this is a gcc compiler issue. I'll post the "emerge --info" later. Meanwhile, I'm going to start dropping back to earlier versions of gcc and see if I can find one that works.
Comment 1 M. Edward Borasky 2007-08-02 03:50:18 UTC
Created attachment 126671 [details]
emerge --info

Ignore the CFLAGS -- they are set in the scripts that do the compile/link rather than inherited from the environment
Comment 2 M. Edward Borasky 2007-08-02 04:03:45 UTC
Well, I tried all of the gcc versions I have:

 [1] x86_64-pc-linux-gnu-3.4.6 *
 [2] x86_64-pc-linux-gnu-3.4.6-hardened
 [3] x86_64-pc-linux-gnu-3.4.6-hardenednopie
 [4] x86_64-pc-linux-gnu-3.4.6-hardenednopiessp
 [5] x86_64-pc-linux-gnu-3.4.6-hardenednossp
 [6] x86_64-pc-linux-gnu-4.1.2
 [7] x86_64-pc-linux-gnu-4.2.0

(except the hardened ones) and none of them can compile/link this with the flag set. Just about has to be upstream, or maybe it's actually in binutils or gclib??
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-08-02 04:05:43 UTC

*** This bug has been marked as a duplicate of bug 146895 ***