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]

fix profiling on Darwin


This patch:

2003-01-27  Nathan Sidwell  <nathan@codesourcery.com>

	* Makefile.in (LIB2FUNCS_ST): Remove _gcov.
	(LIBGCOV): New variable.
	(libgcc.mk): Add LIBGCOV.
	(LIBGCC_DEPS): Add libgcov.c.
	(libgcov.a): New target.
	(clean): Remove libgcov.a.
	(install-libgcc): Do libgcov too.
	(stage1-start, stage2-start, stage3-start, stage4-start): Deal
	with libgcov.a.
	* libgcc2.c (L_gcov): Move into ...
	* libgcov.c: ... here. New file.
	* mklibgcc.in: Add libgcov rules.
	* gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling.

broke profiling on Darwin because Darwin has its own
LINK_COMMAND_SPEC and Nathan didn't update it.  This patch fixes it.

Probably djgpp also needs a similar patch since it also has its own
LINK_COMMAND_SPEC.

Bootstrapped & tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwingprof.patch=====================
2003-01-31  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_COMMAND_SPEC): Update for Nathan's recent
	change to LINK_COMMAND_SPEC in gcc.c.

Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.47
diff -u -p -u -p -r1.47 darwin.h
--- config/darwin.h	3 Jan 2003 23:09:32 -0000	1.47
+++ config/darwin.h	31 Jan 2003 23:03:31 -0000
@@ -190,7 +190,8 @@ Boston, MA 02111-1307, USA.  */
     %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
     %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
     %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
-    %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%G %L}} \
+    %{L*} %(link_libgcc) %o %{fprofile-arcs:-lgcov} \
+    %{!nostdlib:%{!nodefaultlibs:%G %L}} \
     %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} \
     %{!--help:%{!no-c++filt|c++filt:| c++filt3 }} }}}}}}}}"
 
============================================================


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