Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 2004 12:06:22 +0900
From:      Till Plewe <till@score.is.tsukuba.ac.jp>
To:        freebsd-amd64@freebsd.org
Subject:   Re: profiling on amd64
Message-ID:  <20040519030622.GA78298%till@score.is.tsukuba.ac.jp>
In-Reply-To: <200405181557.53839.peter@wemm.org>
References:  <20040518050421.GA75633%till@score.is.tsukuba.ac.jp> <20040518070430.GA68449@cat.robbins.dropbear.id.au> <200405180946.38351.peter@wemm.org> <200405181557.53839.peter@wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 18, 2004 at 03:57:53PM -0700, Peter Wemm wrote:
> On Tuesday 18 May 2004 09:46 am, Peter Wemm wrote:
> > On Tuesday 18 May 2004 12:04 am, Tim Robbins wrote:
> > > On Tue, May 18, 2004 at 02:04:21PM +0900, Till Plewe wrote:
> > > > The program "int main(){return 0;}" fails to compile if I use the
> > > > option "-pg". The error message I get starts with:

...

> > > This is a bug in the FreeBSD/x86-64 GCC configuration. It should be
> > > calling ``.mcount'' instead of ``mcount'' (note the full-stop at
> > > the start of the name.) After applying this patch, rebuilding gcc,
> > > and rebuilding the profiled C library, gcc -pg does not cause
> > > linker errors:
> > >
> > > ====
> > > //depot/user/tjr/freebsd-tjr/src/contrib/gcc/config/i386/freebsd64.
> > >h# 5 - /home/tim/p4/src/contrib/gcc/config/i386/freebsd64.h ==== @@
> > > -25,6 +25,9 @@
> > >  #undef  TARGET_VERSION
> > >  #define TARGET_VERSION fprintf (stderr, " (FreeBSD/x86-64 ELF)");
> > >
> > > +#undef  MCOUNT_NAME
> > > +#define MCOUNT_NAME ".mcount"
> > > +
> > >  #undef  FBSD_TARGET_CPU_CPP_BUILTINS
> > >  #define FBSD_TARGET_CPU_CPP_BUILTINS()		\
> > >    do						\

...

> OK, I've tracked down the missing parts of userland profiling and made 
> it work.  You'll still need the above patch to gcc and do a buildworld 
> otherwise there will be undefined references to mcount in libc_p.a etc.

Thanks. Everything seems to be working perfectly now. 

- Till



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040519030622.GA78298%till>