Bug 13490 - ld gives dynamic STT_GNU_IFUNC symbol `strcmp' error when linking with c_p.a
Summary: ld gives dynamic STT_GNU_IFUNC symbol `strcmp' error when linking with c_p.a
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 11:47 UTC by Shlomi Fish
Modified: 2012-01-16 09:12 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-linux
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shlomi Fish 2011-12-12 11:47:20 UTC
When I try to link a program that uses strcmp() against the profiling libc on Mageia Linux Cauldron, I'm getting this error:

gcc -Wall -Werror=implicit-function-declaration -g -fPIC -DFCS_FREECELL_ONLY=1 
-fwhole-program -o fc-solve -Wl,-rpath,.  -L. main.o -lfcs -pg -lc_p -lm_p
-static-libgcc
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in
`/usr/lib/gcc/x86_64-mageia-linux-gnu/4.5.2/../../../../lib64/libc_p.a(strcmp.op)'
can not be used when making an executable; recompile with -fPIE and relink with
-pie

The program is:

https://fc-solve.googlecode.com/svn/fc-solve/trunk/fc-solve/source

with this patch: 

Index: Makefile.gnu
===================================================================
--- Makefile.gnu        (revision 4223)
+++ Makefile.gnu        (working copy)
@@ -1,5 +1,5 @@
-DEBUG = 0
-PROFILE = 0
+DEBUG = 1
+PROFILE = 1
 WITH_TRACES = 0
 FREECELL_ONLY = 1
 DISABLE_SIMPLE_SIMON := 0
shlomif[fcs]:$trunk/fc-solve/source$ 

And after doing "make -f Makefile.gnu". It seems this bug in a similar
variation was reported here:

* https://bugzilla.redhat.com/show_bug.cgi?id=642999

* https://bugs.gentoo.org/show_bug.cgi?id=332905

* https://bugs.mageia.org/show_bug.cgi?id=3583

I tried disabling gold by rebuilding binutils without it but I got the same output from gcc.

Any fix or insight would be appreciated.

Regards,

-- Shlomi Fish