[Bug 667470] Re: Linking against libc built with profiling fails
Balint Reczey
667470 at bugs.launchpad.net
Tue Dec 15 20:44:20 UTC 2020
The libc6-prof package (in the form this bug has been written against)
has been removed after the 14.04 release.
** Changed in: glibc (Ubuntu)
Status: Confirmed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/667470
Title:
Linking against libc built with profiling fails
Status in glibc package in Ubuntu:
Fix Released
Bug description:
I'm trying to build my program with the libc profiling (from package
libc6-prof) enabled, and it doesn't work at all.
$ lsb_release -rd
Description: Ubuntu 10.10
Release: 10.10
The README says I should add "-static-libgcc -lc_p" to my link line,
but if I do that I get:
gcc -g -pg -o foobar ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o implicit.o job.o main.o misc.o read.o remake.o remote-stub.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o -lrt -static-libgcc -lc_p
read.o: In function `tilde_expand':
read.c:2968: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libc_p.a(strcmp.op)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
If I take out the -static-libgcc (but leave in -lc_p of course) I get
the same error.
If I try linking my application statically, by adding -static to the
link line, then I get just the warning:
read.c:2968: warning: Using 'getpwnam' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
and the link succeeds, but if I try to run the executable it simply
coredumps:
$ ./foobar
Segmentation fault
GDB says:
(gdb) run
Starting program: foobar
Program received signal SIGSEGV, Segmentation fault.
0x000000000049be0b in __mcount_internal ()
Of course if I build without profiling it works fine.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/667470/+subscriptions
More information about the foundations-bugs
mailing list