[ruby-core:26474] Building with gcov

View: New views
3 Messages — Rating Filter:   Alert me  

[ruby-core:26474] Building with gcov

by Aaron Patterson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Does anyone have any pointers for building ruby with gcov?  I see that
Yusuke has done it before:

  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/33258

But I am having problems.  I run configure like this:

  $ CFLAGS='-fprofile-arcs -ftest-coverage' LIBS=-lgcov ./configure

Everything seems to build OK until bigdecimal.  mkmf complains saying it
couldn't build an executable.  Here is the output from my mkmf.log:

  http://pastie.org/679430

I'm not sure why this error would crop up with those CFLAGS and LIBS
though.  Any help would be appreciated.  Thanks!

--
Aaron Patterson
http://tenderlovemaking.com/


[ruby-core:26478] Re: Building with gcov

by Yusuke ENDOH :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

2009/11/2 Aaron Patterson <aaron@...>:
> Does anyone have any pointers for building ruby with gcov?  I see that
> Yusuke has done it before:
>
>  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/33258
>
> But I am having problems.  I run configure like this:
>
>  $ CFLAGS='-fprofile-arcs -ftest-coverage' LIBS=-lgcov ./configure


How about

  CFLAGS="-fprofile-arcs -ftest-coverage" \
  DLDFLAGS="-Wl,-whole-archive -lgcov -Wl,-no-whole-archive" \
  ./configure

?

--
Yusuke ENDOH <mame@...>


[ruby-core:26485] Re: Building with gcov

by Aaron Patterson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 02, 2009 at 12:26:37PM +0900, Yusuke ENDOH wrote:

> Hi,
>
> 2009/11/2 Aaron Patterson <aaron@...>:
> > Does anyone have any pointers for building ruby with gcov?  I see that
> > Yusuke has done it before:
> >
> >  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/33258
> >
> > But I am having problems.  I run configure like this:
> >
> >  $ CFLAGS='-fprofile-arcs -ftest-coverage' LIBS=-lgcov ./configure
>
>
> How about
>
>   CFLAGS="-fprofile-arcs -ftest-coverage" \
>   DLDFLAGS="-Wl,-whole-archive -lgcov -Wl,-no-whole-archive" \
>   ./configure

It seems the linker flags are somewhat different on OS X.
"-whole-archive" is supposed to be replaced with "-all_load", but I
can't seem to find a replacement for "-no-whole-archive".  The
replacement was *supposed* to be "-noall_load", but that seems to be
deprecated and ignored.

I'll keep researching on OS X, but build on linux for now.  Thanks for
the pointers!

--
Aaron Patterson
http://tenderlovemaking.com/