This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch Darwin] proposal for a 4.6 work-around to dsymutil calling issues.
- From: IainS <developer at sandoe-acoustics dot co dot uk>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Mike Stump <mrs at gcc dot gnu dot org>, "Peter O'Gorman" <pogma at thewrittenword dot com>, Dominique Dhumieres <dominiq at lps dot ens dot fr>, Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Date: Thu, 2 Dec 2010 11:45:42 +0000
- Subject: [Patch Darwin] proposal for a 4.6 work-around to dsymutil calling issues.
Hi,
PR43751 and PR46749 show that we have a problem with the existing way
in which dsymutil is called by trying to recognize that the c/l
contains a source file.
Not only do we not cover all source types, but the whole thing breaks
down with relatively benign changes in the c/l.
AFAICT, we don't really have a suitable facility to:
'determine that a source is present for the set of supported languages
and insert a flag'
On the basis that such a wide-ranging addition might not be
appropriate for stage-3
- - I'm going to propose a work-around and suggest an enhancement bug
for 4.7?
Of course, if someone knows a better solution .. great!
The change is this:
When the user wants a dSYM (s)he will now need to append "-dsym" to
the c/l - instead of gcc figuring it out automatically.
If there are no existing "-g*" on the c/l "-g" will be appended.
I have not yet written doc for this - pending comments on whether it's
considered a reasonable work-around for 4.6.
thoughts?
Iain
Index: gcc/config/darwin.opt
===================================================================
--- gcc/config/darwin.opt (revision 167325)
+++ gcc/config/darwin.opt (working copy)
@@ -88,6 +88,12 @@ Driver
gused
Driver
+dsym
+Driver
+
+Zdsym
+Driver
+
image_base
Driver Separate Alias(Zimage_base)
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h (revision 167325)
+++ gcc/config/darwin.h (working copy)
@@ -126,6 +126,7 @@ extern GTY(()) int darwin_ms_struct;
#define DRIVER_SELF_SPECS \
"%{gfull:-g -fno-eliminate-unused-debug-symbols} %<gfull", \
"%{gused:-g -feliminate-unused-debug-symbols} %<gused", \
+ "%{dsym: -Zdsym %{!g*:-g }} %<dsym", \
"%{fapple-kext|mkernel:-static}", \
"%{shared:-Zdynamiclib} %<shared"
@@ -188,8 +189,7 @@ extern GTY(()) int darwin_ms_struct;
#define DSYMUTIL_SPEC \
"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
- %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
- %{gdwarf-2:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!
o:a.out}}}}}}}}}}}}"
+ %{Zdsym:%{gdwarf-2:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!
o:a.out}}}}}}}}}}}}"
#define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC
Index: gcc/config/darwin9.h
===================================================================
--- gcc/config/darwin9.h (revision 167325)
+++ gcc/config/darwin9.h (working copy)
@@ -27,8 +27,7 @@ along with GCC; see the file COPYING3. If not see
#undef DSYMUTIL_SPEC
#define DSYMUTIL_SPEC \
"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
- %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s: \
- %{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+ %{Zdsym:%{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!
o:a.out}}}}}}}}}}}}"
/* libSystem contains unwind information for signal frames. */
#define DARWIN_LIBSYSTEM_HAS_UNWIND