* undefined reference to `mcount'
@ 2014-11-05 14:31 Shwetabh
2014-11-05 14:36 ` John Spencer
0 siblings, 1 reply; 2+ messages in thread
From: Shwetabh @ 2014-11-05 14:31 UTC (permalink / raw)
To: musl
[-- Attachment #1: Type: text/plain, Size: 564 bytes --]
Hello Everyone ,
I am trying to link a normal hello world program with musl-libc with -pg
option ( for profiling with gprof) following error i am getting
shwetabh@shwetabh-Aspire-4930:~/study/musl-1.1.5$
/usr/local/musl/bin/musl-gcc -pg hello.c
/tmp/ccdspYkY.o: In function `main':
hello.c:(.text+0xa): undefined reference to `mcount'
collect2: error: ld returned 1 exit status
without -pg option i am able to successfully link the program and can able
to execute it .
Requesting anyone to please provide the workaround for the error.
--
Shwetabh Srivastava
[-- Attachment #2: Type: text/html, Size: 792 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: undefined reference to `mcount'
2014-11-05 14:31 undefined reference to `mcount' Shwetabh
@ 2014-11-05 14:36 ` John Spencer
0 siblings, 0 replies; 2+ messages in thread
From: John Spencer @ 2014-11-05 14:36 UTC (permalink / raw)
To: musl; +Cc: shwetabh.mmmec
Shwetabh wrote:
> Hello Everyone ,
>
> I am trying to link a normal hello world program with musl-libc with -pg
> option ( for profiling with gprof) following error i am getting
>
> shwetabh@shwetabh-Aspire-4930:~/study/musl-1.1.5$
> /usr/local/musl/bin/musl-gcc -pg hello.c
> /tmp/ccdspYkY.o: In function `main':
> hello.c:(.text+0xa): undefined reference to `mcount'
> collect2: error: ld returned 1 exit status
>
> without -pg option i am able to successfully link the program and can able
> to execute it .
>
> Requesting anyone to please provide the workaround for the error.
there is no workaround.
using the -pg option of gcc emits code that assumes helper functionality
and special startup code provided by glibc.
as those startup functions need to be written in assembly, no one felt
the urge to implement them for musl yet.
especially since the "perf" tool (part of the kernel source or
distributed as a package in your distro) provides a much better
profiling facility that works with all existing binaries.
--JS
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-05 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-05 14:31 undefined reference to `mcount' Shwetabh
2014-11-05 14:36 ` John Spencer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).