Bug 3583 - Static Linking with the Profiling libc Library Fails with an error.
: Static Linking with the Profiling libc Library Fails with an error.
Status: REOPENED
Product: Mageia
Classification: Unclassified
Component: RPM Packages
: Cauldron
: x86_64 Linux
: Normal Severity: normal
: ---
Assigned To: Thomas Backlund
:
:
: MGA4TOO
: Triaged
:
:
  Show dependency treegraph
 
Reported: 2011-12-02 21:16 CET by Shlomi Fish
Modified: 2015-04-19 15:16 CEST (History)
1 user (show)

See Also:
Source RPM: binutils
CVE:


Attachments

Description Shlomi Fish 2011-12-02 21:16:33 CET
When I try to link a program that uses strcmp() against the profiling libc, 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

Any fix or insight would be appreciated.

Regards,

-- Shlomi Fish
Comment 1 Manuel Hiebel 2011-12-03 00:09:00 CET
Hi, thanks for reporting this bug.
Assigned to the package maintainer.
Comment 2 Shlomi Fish 2011-12-03 10:04:27 CET
(In reply to comment #1)
> Hi, thanks for reporting this bug.
> Assigned to the package maintainer.

Well, you've set the package to "lvm2", but it's a global problem with GNU ld that I've ran into with my own code.

Regards,

-- Shlomi Fish
Comment 3 Shlomi Fish 2011-12-12 11:01:12 CET
Assigning to the correct package - "binutils", as it is a problem with /usr/bin/ld.
Comment 4 Marja van Waes 2012-03-14 21:57:11 CET
Pinging, because nothing has happened with this report for more than 3 months, it still has the status NEW or REOPENED.

@ tmb

Please set status to ASSIGNED if you think this bug was assigned correctly. If for work flow reasons you can't do that, then please put OK on the whiteboard instead.
Comment 5 Marja van Waes 2012-05-26 13:07:51 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja
Comment 6 Marja van Waes 2012-07-06 15:04:28 CEST
Please look at the bottom of this mail to see whether you're the assignee of this  bug, if you don't already know whether you are.


If you're the assignee:

We'd like to know for sure whether this bug was assigned correctly. Please change status to ASSIGNED if it is, or put OK on the whiteboard instead.

If you don't have a clue and don't see a way to find out, then please put NEEDHELP on the whiteboard.

Please assign back to Bug Squad or to the correct person to solve this bug if we were wrong to assign it to you, and explain why.

Thanks :)

**************************** 

@ the reporter and persons in the cc of this bug:

If you have any new information that wasn't given before (like this bug being valid for another version of Mageia, too, or it being solved) please tell us.

@ the reporter of this bug

If you didn't reply yet to a request for more information, please do so within two weeks from now.

Thanks all :-D
Comment 7 Shlomi Fish 2012-07-06 17:51:10 CEST
This bug still exists in Mageia Linux Cauldron (also in Mageia 2). Removing "NEEDINFO".
Comment 8 Marja van Waes 2015-04-18 20:51:52 CEST
Sorry, but this bug saw no action since over 2 yrs ago. 
No cauldron package has stayed the same since then.

Closing as OLD

Please reopen if this report is still valid for _current_ cauldron and/or fully
updated Mageia 4
Comment 9 Shlomi Fish 2015-04-19 08:59:49 CEST
Still happens on Mageia Cauldron x86-64 (What will become Mageia 5):

shlomif[fcs]:$trunk/fc-solve/B$ make -f ../source/Makefile.gnu SRC_DIR=$(pwd)/../source 
gcc -Wall -DFCS_DBM_USE_LIBAVL=1 -I. -I/home/shlomif/progs/freecell/git/fc-solve/fc-solve/B/../source/libavl/ -I/home/shlomif/progs/freecell/git/fc-solve/fc-solve/B/../source -I/home/shlomif/progs/freecell/git/fc-solve/fc-solve/B/../source/patsolve-shlomif/patsolve -Werror=implicit-function-declaration -std=gnu99 -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.9.2/../../../../lib64/libc_p.a(strcmp.op)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: error: ld returned 1 exit status
../source/Makefile.gnu:252: recipe for target 'fc-solve' failed
make: *** [fc-solve] Error 1
shlomif[fcs]:$trunk/fc-solve/B$ 

Reopening.
Comment 10 Marja van Waes 2015-04-19 10:37:24 CEST
(In reply to Shlomi Fish from comment #9)

> 
> Reopening.

I suppose that Gentoo patch is useless, because it is about patching lvm2 instead of binutils.

Removing the link.

I don't see anything in RedHat bugzilla about this issue in Fedora 20 or later. 
That might be because I didn't search well enough. 
However, if you do have a Rawhide (or 21 or 20) at hand: does it fail there, too?
Comment 11 Shlomi Fish 2015-04-19 12:51:44 CEST
(In reply to Marja van Waes from comment #10)
> (In reply to Shlomi Fish from comment #9)
> 
> > 
> > Reopening.
> 
> I suppose that Gentoo patch is useless, because it is about patching lvm2
> instead of binutils.
> 
> Removing the link.
> 
> I don't see anything in RedHat bugzilla about this issue in Fedora 20 or
> later. 
> That might be because I didn't search well enough. 
> However, if you do have a Rawhide (or 21 or 20) at hand: does it fail there,
> too?

I will test it in a VM and let you know.

Thanks!
Comment 12 Shlomi Fish 2015-04-19 14:52:27 CEST
An update, I have installed a Fedora 21 x86-64 VM and discovered that the glibc-profile package there is no longer available for it. I can try it with what is reported at https://bugzilla.redhat.com/show_bug.cgi?id=642999 and check the static library. Will that be adequate?
Comment 13 Marja van Waes 2015-04-19 15:16:14 CEST
(In reply to Shlomi Fish from comment #12)
> An update, I have installed a Fedora 21 x86-64 VM and discovered that the
> glibc-profile package there is no longer available for it. I can try it with
> what is reported at https://bugzilla.redhat.com/show_bug.cgi?id=642999 and
> check the static library. Will that be adequate?

Sorry, I don't have the slightest idea. Maybe the assignee can tell, but he might be too busy fixing things that affect many more users.

You'll have a much better understanding of static vs dynamic than I have.
In case you didn't read that, here https://bugzilla.redhat.com/show_bug.cgi?id=785399#c20 someone with a similar llvm2 issue, decided to forget about static. Don't know whether that is of any use?

Note You need to log in before you can comment on or make changes to this bug.