libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtool und --coverage


From: Ralf Wildenhues
Subject: Re: Libtool und --coverage
Date: Fri, 25 Aug 2006 17:08:42 +0200
User-agent: Mutt/1.5.12 (2006-08-10)

Hello Rainer, all,

Apologies for the delay.

Newer(?) GCC have an option --coverage:
| `--coverage'
|      This option is used to compile and link code instrumented for
|      coverage analysis.  The option is a synonym for `-fprofile-arcs'
|      `-ftest-coverage' (when compiling) and `-lgcov' (when linking).
|      See the documentation for those options for more details.

If I understand correctly, it is possible to link together objects with
and without this profiling; thus, --coverage need not be an inherited
linker flag.  But above explains that we should allow it through to the
compiler driver for shared library creation (not in linker_flags, this
is not valid for $LD).  Note that -fprofile-arcs and -ftest-coverage are
not needed/used for the link step.

I've applied the patches below to HEAD and branch-1-5, respectively.

Cheers, and thanks for the report,
Ralf

HEAD:
        * libltdl/config/ltmain.m4sh (func_mode_link): Pass through
        `--coverage' and `-pg', for GCC.  Report by Rainer Keller
        <address@hidden> and Tor Lillqvist <address@hidden>.

Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.51
diff -u -r1.51 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  23 Aug 2006 17:57:34 -0000      1.51
+++ libltdl/config/ltmain.m4sh  25 Aug 2006 15:06:15 -0000
@@ -2903,9 +2901,10 @@
       # -q* pass through compiler args for the IBM compiler
       # -m*, -t[45]*, -txscale* pass through architecture-specific
       # compiler args for GCC
+      # -pg, --coverage pass through profiling flag for GCC
       # @file GCC response files
       
-64|-mips[[0-9]]|-r[[0-9]][[0-9]]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[[45]]*|-txscale*|@*)
+      -t[[45]]*|-txscale*|-pg|--coverage|@*)
         func_quote_for_eval "$arg"
        arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"


branch-1-5:
        * ltmain.in (link mode): Pass through `--coverage', for GCC.
        Report by Rainer Keller <address@hidden>.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.133
diff -u -r1.334.2.133 ltmain.in
--- ltmain.in   7 Aug 2006 16:25:31 -0000       1.334.2.133
+++ ltmain.in   25 Aug 2006 15:06:33 -0000
@@ -1660,10 +1660,10 @@
       # -m* pass through architecture-specific compiler args for GCC
       # -m*, -t[45]*, -txscale* pass through architecture-specific
       # compiler args for GCC
-      # -pg pass through profiling flag for GCC
+      # -pg, --coverage pass through profiling flag for GCC
       # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
-      -t[45]*|-txscale*|@*)
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-pg|--coverage|@*)
 
        # Unknown arguments in both finalize_command and compile_command need
        # to be aesthetically quoted because they are evaled later.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]