This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] enable-coverage build


Hi,
an enable-coverage build suffers from some of the issues of a canadian
cross. Namely object files destined for the compiler are compiled and
linked with -ftest-coverage -fprofile-arcs, whereas those for the build
are not (actually, I don't care particularly which they are, but ...).
during stage1, for build=host, we'll use the system gcc compiler for
those latter files, but give it options that only the compiler under
construction understands. Also, there are different link commands for
the former and the latter, such that the latter fail to link with libgcov.

This seems like the most straight forward patch, ok?

booted and tested with --enable-coverage on i686-pc-linux-gnu.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-07-08  Nathan Sidwell  <nathan@codesourcery.com>

	* configure.in (BUILD_PREFIX, BUILD_PREFIX_1): Set if enable
	coverage is on.
	* configure: Regenerated.
	* Makefile.in (ALL_CFLAGS): Correct its comment.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.697
diff -c -3 -p -r1.697 configure.in
*** configure.in	7 Jul 2003 11:12:18 -0000	1.697
--- configure.in	7 Jul 2003 18:23:10 -0000
*************** BUILD_CFLAGS='$(ALL_CFLAGS)'	AC_SUBST(BU
*** 1413,1420 ****
  STMP_FIXINC=stmp-fixinc		AC_SUBST(STMP_FIXINC)
  STMP_FIXPROTO=stmp-fixproto	AC_SUBST(STMP_FIXPROTO)
  
! # And these apply if build != host.
! if test x$build != x$host
  then
      BUILD_PREFIX=build-
      BUILD_PREFIX_1=build-
--- 1413,1420 ----
  STMP_FIXINC=stmp-fixinc		AC_SUBST(STMP_FIXINC)
  STMP_FIXPROTO=stmp-fixproto	AC_SUBST(STMP_FIXPROTO)
  
! # And these apply if build != host, or we are generating coverage data
! if test x$build != x$host -o "x$coverage_flags" != x
  then
      BUILD_PREFIX=build-
      BUILD_PREFIX_1=build-
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1103
diff -c -3 -p -r1.1103 Makefile.in
*** Makefile.in	7 Jul 2003 11:12:25 -0000	1.1103
--- Makefile.in	7 Jul 2003 18:23:19 -0000
*************** CPPLIB_H = cpplib.h line-map.h
*** 667,675 ****
  # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
  INTERNAL_CFLAGS = -DIN_GCC @CROSS@
  
! # This is the variable actually used when we compile.
! # If you change this line, you probably also need to change the definition
! # of BUILD_CFLAGS in build-make to match.
  ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
    $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
  
--- 667,674 ----
  # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
  INTERNAL_CFLAGS = -DIN_GCC @CROSS@
  
! # This is the variable actually used when we compile. If you change this,
! # you probably want to update BUILD_CFLAGS in configure.in
  ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
    $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]