This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] enable-coverage build
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Nathanael Nerode <neroden at twcny dot rr dot com>
- Date: Tue, 08 Jul 2003 09:20:21 +0100
- Subject: [PATCH] enable-coverage build
- Organization: Codesourcery LLC
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@