Using libc5 on Redhat 5.0 and profiling

Jeffrey A Law
Wed Jun 23 02:20:00 GMT 1999

  > I made egcs do this by configuring it as a cross compiler (see below)
  > However, now when I try to use the -pg option, the link fails (the
  > compile works fine):
Either the system should have shipped libgmon, or the glibc1 support in egcs
is broken.

  > Is there a way to get libgmon?
Not a clue.  HJ, what is the store with libgmon & this code from linux.h:

/* We no longer link with libc_p.a or libg.a by default. If you
   want to profile or debug the GNU/Linux C library, please add
   -profile or -ggdb to LDFLAGS at the link time, respectively. */
#if 1
#ifdef USE_GNULIBC_1
#define LIB_SPEC \
  "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \
     %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}"
#define LIB_SPEC \
  "%{shared: -lc} \
   %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
        %{profile:-lc_p} %{!profile: -lc}}"

  > It seems that a native compiler does
  > not even need this library. 
Correct.  Or more correctly glibc2 based systems do not need libgmon.

  > Is there a way to make egcs understand that
  > my cross compiler really is a native compiler?  Or perhaps my approach
  > to making a libc5 compiler is wrong?
Not really since the the need for gmon seems to be triggered by using libc5 and
you need to build & link against libc5 headers & libraries.


More information about the Gcc mailing list