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.
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
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??
*** This bug has been marked as a duplicate of bug 146895 ***