Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 187455 - gcc appears to be generating unlinkable code w/ -fprofile-arcs
Summary: gcc appears to be generating unlinkable code w/ -fprofile-arcs
Status: RESOLVED DUPLICATE of bug 146895
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-02 03:47 UTC by M. Edward Borasky
Modified: 2007-08-02 04:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (info.txt,4.99 KB, text/plain)
2007-08-02 03:50 UTC, M. Edward Borasky
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***