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]

call dsymutil on darwin when compiling and linking in single step


This patch cleans up LINK_COMMAND_SPEC on Darwin to remove obsolete
stuff.  I'm not sure what -@ was supposed to do, but it doesn't work
now; there is no %f spec escape.

It also causes dsymutil to be run when compiling and linking in one
step, as in

gcc hello.c -o hello -g

This is necessary since otherwise the debugger expects to find the
DWARF information in the .o file, but the compiler will have deleted
it.

Bootstrapped & tested on powerpc-darwin8; placed on hold for 4.3.
-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwin-dsymutil.patch=================
2006-09-01  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_COMMAND_SPEC): Don't do weird things with -@.
	Call dsymutil when compiling and linking one or more source files
	in one step.

Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 117405)
+++ gcc/config/darwin.h	(working copy)
@@ -206,16 +206,19 @@
    specifying the handling of options understood by generic Unix
    linkers, and for positional arguments like libraries.  */
 #define LINK_COMMAND_SPEC "\
-%{!fdump=*:%{!fsyntax-only:%{!precomp:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %{!Zdynamiclib:%(linker)}%{Zdynamiclib:/usr/bin/libtool} \
     %l %X %{d} %{s} %{t} %{Z} \
     %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
-    %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
+    %{o*}%{!o:-o a.out} \
     %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
     %{L*} %{fopenmp:%:include(libgomp.spec)%(link_gomp)}   \
     %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
-    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
+    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
+%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+    %{.c|.cc|.C|.cpp|.c++|.CPP|.m|.mm: \
+    %{g*:%{!gstabs*:%{!gnone: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
 
 /* Please keep the random linker options in alphabetical order (modulo
    'Z' and 'no' prefixes).  Options that can only go to one of libtool
============================================================


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