This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, target] Sort out some issues in config{,/*}/darwin*.h
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: IainS <developer at sandoe-acoustics dot co dot uk>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>, Dominique Dhumieres <dominiq at lps dot ens dot fr>, "Peter O'Gorman" <peter at pogma dot com>
- Date: Wed, 14 Apr 2010 13:01:42 -0400
- Subject: Re: [Patch, target] Sort out some issues in config{,/*}/darwin*.h
- References: <7BF29134-0DF8-4621-8012-0935A5926970@sandoe-acoustics.co.uk>
On Wed, Apr 14, 2010 at 05:41:58PM +0100, IainS wrote:
> Hi all,
>
> Whilst this is mostly darwin-specific, it clearly needs build-system
> approval for the generation and installation of "dsymutil-wrapper.sh" in
> $(libexecdir)
>
> References:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43751
> http://gcc.gnu.org/ml/gcc/2010-04/msg00207.html
> http://gcc.gnu.org/ml/fortran/2010-04/msg00131.html
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42333
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43254
>
> Much though I dislike addressing multiple problems in one patch...
> ... this particular area is like a balloon - if you push it in one place
> it just pops out somewhere else.
>
> So this is what I've done:
>
> o Trivial white-space tidies in asm directives (.comm, .lcomm, .glob
> missing leading tabs)
>
> o Split the LINK_COMMAND_SPEC into two bits:
> LINK_COMMAND_SPEC_A Common across the platform.
> DSYMUTIL_SPEC which needs to vary depending on the default debug
> format.
>
> o macro-ized DSYMUTIL so that we can change it without editing the
> specs.
> o Provided a wrapper for the system-supplied dsymutil that allows us to
> edit out bogus warnings.
> this is installed in $(libexecdir) . The initial version filters the
> message that gives us problems
> like PR43254.
>
> o Altered the behavior of DSYMUTIL_SPEC so that it:
> (a) Always runs when we are generating an exe - IMO this is more
> intuitive to the end user - and
> it side-steps the problem with the existing spec.
> (b) it defaults to generation of flat debug (.dwarf) files - you can
> generate the .dSYM by passing
> -mdsym on the c/l (although .dwarf works just fine with the XCode
> gdb AFAICT).
>
> This latter step hopefully will get round the myriad "X.dSYM is
> directory" configury error msgs.
>
> - this now works for all FEs including fortran.
>
> o Filter out -lm and re-apply it where needed. [I've provided a bolt-
> hole for anyone who wants to
> force -lm (-force_lm) at least until we confirm that this is not an
> issue.]
>
> o Remove -lgcc from darwin.h and re-apply it in the rs6000/
> darwin{7,8}.h where it is required
> as the source of save/restore_world (added a FIXME that this
> probably should not be so).
>
> o as a temporary hack - I've placed libgcc.a ahead of libm and
> libsystem on darwin 10. This works
> around PR42333.
Iain,
Have you considered removing the extra -lgcc outright instead?
>From the comments of the Apple clang programmers...
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42333#c44
they are heading in that direction soon.
Jack
>
> o fixed darwin10 not to provide no_compact_unwind when building for
> <10.6.
>
>
> Have fun.. and I'd welcome comments on improvements.
>
> Iain
>
> gcc/ChangeLog:
>
> * dsymutil-wrapper.sh.in: New.
> * Makefile.in: Build and install (to libexecdir) dsymutil-wrapper.sh.
> * config/i386/darwin.h: Correct tabs before asm directives.
> * config/rs6000/darwin.h: Ditto.
> * config/rs6000/darwin7.h: Add -lgcc to LIB_SPEC and add FIXME note.
> * config/rs6000/darwin8.h: Ditto.
> * config/darwin.h: Correct tabs before asm directives.
> Split LINK_COMMAND_SPEC into
> (LINK_COMMAND_SPEC_A): New. (DSYMUTIL_SPEC): New.
> Remove source code dependency on dsymutils running. Reference
> dsymutil-wrapper.sh. Strip -lm from Darwin versions that supply
> this in libSystem or libgcc_s. Remove -lgcc catch-all from the
> LIB_SPEC.
> (DEBUG_INLINED_SECTION): New macro.
> * config/darwin9.h: LINK_COMMAND_SPEC: Use LINK_COMMAND_SPEC_A.
> (DSYMUTIL_SPEC): New.
> Correct tabs before asm directives.
> * config/darwin10.h: Reference libgcc.a before libm and libSystem
> to work around PR42333. Add FIXME note. Make "no_compact_unwind"
> depend on targetting >= 10.6.
>
>
>
> Index: gcc/dsymutil-wrapper.sh.in
> ===================================================================
> --- gcc/dsymutil-wrapper.sh.in (revision 0)
> +++ gcc/dsymutil-wrapper.sh.in (revision 0)
> @@ -0,0 +1,36 @@
> +#!/bin/sh
> +#
> +# Wrapper script for dsymutil on Darwin (Mac OS X) systems.
> +# Copyright (C) 2010 Free Software Foundation, Inc.
> +# Contributed by Iain Sandoe <iains@gcc.gnu.org>.
> +#
> +# This file is part of GCC.
> +#
> +# GCC is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3, or (at your option)
> +# any later version.
> +#
> +# GCC is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with GCC; see the file COPYING3. If not see
> +# <http://www.gnu.org/licenses/>. */
> +#
> +#
> +# Disable bogus warnings from dsymutil that upset our testsuite.
> +#
> +# Passing '-Wdsymutil' as argument 1 to the script will bypass the
> +# filter.
> +
> +case "$1" in
> + -Wdsymutil)
> + shift; dsymutil $* ; exit $status ;;
> +
> + *)
> + dsymutil $* | sed /warning:\ DWARFDebugInfoEntry::AppendDependants\(\)\ --\ check\ on\ this\ item\ TAG_subrange_type:\ attr\ =\ \ AT_upper_bound\ \ form\ =\ FORM_ref4/d ;;
> +esac
> +exit 0
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in (revision 158296)
> +++ gcc/Makefile.in (working copy)
> @@ -1455,7 +1455,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn
> genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
> xgcc$(exeext) cpp$(exeext) cc1$(exeext) cc1*-dummy$(exeext) $(EXTRA_PASSES) \
> $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
> - $(SPECS) collect2$(exeext) lto-wrapper$(exeext) \
> + $(SPECS) collect2$(exeext) lto-wrapper$(exeext) dsymutil-wrapper.sh \
> gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
> *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk
>
> @@ -1729,7 +1729,7 @@ all.internal: start.encap rest.encap doc
> all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
> libgcc-support lang.all.cross doc @GENINSRC@ srcextra
> # This is what must be made before installing GCC and converting libraries.
> -start.encap: native xgcc$(exeext) cpp$(exeext) specs \
> +start.encap: native xgcc$(exeext) cpp$(exeext) specs dsymutil-wrapper.sh \
> libgcc-support lang.start.encap @GENINSRC@ srcextra
> # These can't be made until after GCC can run.
> rest.encap: lang.rest.encap
> @@ -2037,6 +2037,9 @@ lto-wrapper$(exeext): lto-wrapper.o intl.o $(LIBDE
>
> lto-wrapper.o: lto-wrapper.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h
>
> +dsymutil-wrapper.sh: $(srcdir)/dsymutil-wrapper.sh.in
> + cp -pf $(srcdir)/dsymutil-wrapper.sh.in $@
> +
> # A file used by all variants of C.
>
> c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
> @@ -4253,8 +4256,8 @@ maintainer-clean:
> # Install the driver last so that the window when things are
> # broken is small.
> install: install-common $(INSTALL_HEADERS) \
> - install-cpp install-man install-info install-@POSUB@ \
> - install-driver install-lto-wrapper
> + install-cpp install-man install-info install-@POSUB@ install-dsymutil-wrapper \
> + install-driver install-lto-wrapper
>
> ifeq ($(enable_plugin),yes)
> install: install-plugin
> @@ -4564,6 +4567,9 @@ install-collect2: collect2 installdirs
> install-lto-wrapper: lto-wrapper$(exeext)
> $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
>
> +install-dsymutil-wrapper: dsymutil-wrapper.sh
> + $(INSTALL_SCRIPT) dsymutil-wrapper.sh $(DESTDIR)$(libsubdir)/dsymutil-wrapper.sh
> +
> # Cancel installation by deleting the installed files.
> uninstall: lang.uninstall
> -rm -rf $(DESTDIR)$(libsubdir)
> Index: gcc/config/i386/darwin.h
> ===================================================================
> --- gcc/config/i386/darwin.h (revision 158296)
> +++ gcc/config/i386/darwin.h (working copy)
> @@ -198,9 +198,9 @@ along with GCC; see the file COPYING3. If not see
> do { if ((LOG) != 0) \
> { \
> if (in_section == text_section) \
> - fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
> + fprintf (FILE, "%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
> else \
> - fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
> + fprintf (FILE, "%s %d\n", ALIGN_ASM_OP, (LOG)); \
> } \
> } while (0)
>
> @@ -208,7 +208,7 @@ along with GCC; see the file COPYING3. If not see
> to define a global common symbol. */
>
> #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
> -( fputs (".comm ", (FILE)), \
> +( fputs ("\t.comm ", (FILE)), \
> assemble_name ((FILE), (NAME)), \
> fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (ROUNDED)))
>
> @@ -216,7 +216,7 @@ along with GCC; see the file COPYING3. If not see
> to define a local common symbol. */
>
> #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
> -( fputs (".lcomm ", (FILE)), \
> +( fputs ("\t.lcomm ", (FILE)), \
> assemble_name ((FILE), (NAME)), \
> fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (ROUNDED)))
>
> Index: gcc/config/rs6000/darwin7.h
> ===================================================================
> --- gcc/config/rs6000/darwin7.h (revision 158296)
> +++ gcc/config/rs6000/darwin7.h (working copy)
> @@ -24,7 +24,19 @@ along with GCC; see the file COPYING3. If not see
> looked for in libmx first. Include libmx by default because otherwise
> libstdc++ isn't usable. */
>
> +/* Include lm if we've been asked for it and we're on a system for which it
> + makes sense. Note that the spec does not preclude a static version of
> + libm.
> +*/
> +
> +/* FIXME:
> + We need the -lgcc here because we still pickup save/restore_world
> + from there.
> +*/
> +
> #undef LIB_SPEC
> -#define LIB_SPEC "%{!static:\
> - %:version-compare(!< 10.3 mmacosx-version-min= -lmx)\
> - -lSystem}"
> +#define LIB_SPEC \
> + "%{Zlm:%:version-compare(< 10.4 mmacosx-version-min= -lm) } %<Zlm \
> + %{!static: -lgcc \
> + %:version-compare(!< 10.3 mmacosx-version-min= -lmx)\
> + -lSystem}"
> Index: gcc/config/rs6000/darwin8.h
> ===================================================================
> --- gcc/config/rs6000/darwin8.h (revision 158296)
> +++ gcc/config/rs6000/darwin8.h (working copy)
> @@ -26,7 +26,14 @@ along with GCC; see the file COPYING3. If not see
> libSystemStubs when compiling on (not necessarily for) 8.0 and
> above and not 64-bit long double. */
>
> +/* FIXME:
> + We need the -lgcc here because we still pickup save/restore_world
> + from there.
> +*/
> +
> #undef LIB_SPEC
> -#define LIB_SPEC "%{!static:\
> - %{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \
> - %{!m64:%:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)} -lSystem}"
> +#define LIB_SPEC \
> + "%{Zlm:%:version-compare(< 10.4 mmacosx-version-min= -lm) } %<Zlm \
> + %{!static: -lgcc \
> + %{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \
> + %{!m64:%:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)} -lSystem}"
> Index: gcc/config/rs6000/darwin.h
> ===================================================================
> --- gcc/config/rs6000/darwin.h (revision 158296)
> +++ gcc/config/rs6000/darwin.h (working copy)
> @@ -247,7 +247,7 @@
> #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
> do { \
> unsigned HOST_WIDE_INT _new_size = SIZE; \
> - fputs (".comm ", (FILE)); \
> + fputs ("\t.comm ", (FILE)); \
> RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
> if (_new_size == 0) _new_size = 1; \
> fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", _new_size); \
> Index: gcc/config/darwin.h
> ===================================================================
> --- gcc/config/darwin.h (revision 158296)
> +++ gcc/config/darwin.h (working copy)
> @@ -144,7 +144,19 @@ extern GTY(()) int darwin_ms_struct;
> command-line option translations specific to the particular target
> architecture. */
>
> +/* We want to control the positioning and/or inclusion of -lm on
> + Darwin/OSX systems which, post 10.3.9, obtain the math functions
> + from either libgcc_s or libSystem.
> +
> + Since '-lm' is treated as an output file we cannot act on it directly
> + and have to turn it into a flag we can manipulate. Once used, the
> + flag must be deleted with (%<Zlm). For the sake of allowing a user
> + to override this behavior -force_lm undoes this. */
> +
> #define TARGET_OPTION_TRANSLATE_TABLE \
> + { "-lm", "-Zlm" }, \
> + { "-force_lm", "-lm" }, \
> + { "-Wdsymutil", "-Zwds" }, \
> { "-all_load", "-Zall_load" }, \
> { "-allowable_client", "-Zallowable_client" }, \
> { "-arch_errors_fatal", "-Zarch_errors_fatal" }, \
> @@ -262,12 +274,14 @@ extern GTY(()) int darwin_ms_struct;
> precomp, libtool, and fat build additions. Also we
> don't specify a second %G after %L because libSystem is
> self-contained and doesn't need to link against libgcc.a. */
> +
> /* In general, random Darwin linker flags should go into LINK_SPEC
> instead of LINK_COMMAND_SPEC. The command spec is better for
> specifying the handling of options understood by generic Unix
> linkers, and for positional arguments like libraries. */
> -#define LINK_COMMAND_SPEC "\
> -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> +
> +#define LINK_COMMAND_SPEC_A \
> + "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> %(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \
> %{A} %{e*} %{m} %{r} %{x} \
> %{o*}%{!o:-o a.out} \
> @@ -276,11 +290,25 @@ extern GTY(()) int darwin_ms_struct;
> %{fopenmp|ftree-parallelize-loops=*: \
> %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
> %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
> - %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
> -%{!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}}}}}}}}}}}}"
> + %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n"
>
> +/* Horrible hackery to work around a dsymutil bug. If you pass -Wdsymutil
> + as the first item to the wrapper, you will get all dsymutil warnings. */
> +#define DSYMUTIL "dsymutil-wrapper.sh"
> +
> +/* We will default to generation of flat debug files. This is more
> + compatible with the majority of c/l and configury projects.
> + An new c/l switch is invented here (-mdysm) that causes dsymutil
> + to generate a .dSYM directory structure. This latter is the
> + behavior of the XCode toolset on an OSX/Darwin system. */
> +
> +#define DSYMUTIL_SPEC \
> +"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> + %{gdwarf*:%{!gstabs*:%{!g0: " DSYMUTIL " %{Zwds:-Wdsymutil} \
> + %{!mdsym: -f } %{o*:%*}%{!o:a.out}}}}}}}}}}}"
> +
> +#define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC
> +
> #ifdef TARGET_SYSTEM_ROOT
> #define LINK_SYSROOT_SPEC \
> "%{isysroot*:-syslibroot %*;:-syslibroot " TARGET_SYSTEM_ROOT "}"
> @@ -374,11 +402,17 @@ extern GTY(()) int darwin_ms_struct;
> %{whatsloaded} %{dylinker_install_name*} \
> %{dylinker} %{Mach} "
>
> -
> /* Machine dependent libraries. */
>
> -#define LIB_SPEC "%{!static:-lSystem}"
> +/* Include lm if we've been asked for it and we're on a system for which it
> + makes sense. Note that the spec does not preclude a static version of
> + libm.
> +*/
>
> +#define LIB_SPEC \
> + "%{Zlm:%:version-compare(< 10.4 mmacosx-version-min= -lm) } %<Zlm \
> + %{!static:-lSystem}"
> +
> /* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
> libraries to link against, and by not linking against libgcc_s on
> earlier-than-10.3.9.
> @@ -397,15 +431,15 @@ extern GTY(()) int darwin_ms_struct;
> "%{static-libgcc|static: -lgcc_eh -lgcc; \
> shared-libgcc|fexceptions|fgnu-runtime: \
> %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
> - %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
> + %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
> %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
> %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
> - -lgcc; \
> + ; \
> :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
> - %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
> + %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
> %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
> %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
> - -lgcc}"
> + }"
>
> /* We specify crt0.o as -lcrt0.o so that ld will search the library path.
>
> @@ -467,6 +501,7 @@ extern GTY(()) int darwin_ms_struct;
> #define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug"
> #define DEBUG_PUBNAMES_SECTION "__DWARF,__debug_pubnames,regular,debug"
> #define DEBUG_PUBTYPES_SECTION "__DWARF,__debug_pubtypes,regular,debug"
> +#define DEBUG_INLINED_SECTION "__DWARF,__debug_inlined,regular,debug"
> #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug"
> #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug"
>
> @@ -701,12 +736,12 @@ int darwin_label_is_anonymous_local_objc_name (con
> #define DATA_SECTION_ASM_OP "\t.data"
>
> #undef ALIGN_ASM_OP
> -#define ALIGN_ASM_OP ".align"
> +#define ALIGN_ASM_OP "\t.align"
>
> #undef ASM_OUTPUT_ALIGN
> #define ASM_OUTPUT_ALIGN(FILE,LOG) \
> if ((LOG) != 0) \
> - fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG))
> + fprintf (FILE, "%s %d\n", ALIGN_ASM_OP, (LOG))
>
> /* Ensure correct alignment of bss data. */
>
> @@ -714,7 +749,7 @@ int darwin_label_is_anonymous_local_objc_name (con
> #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
> do { \
> unsigned HOST_WIDE_INT _new_size = SIZE; \
> - fputs (".lcomm ", (FILE)); \
> + fputs ("\t.lcomm ", (FILE)); \
> assemble_name ((FILE), (NAME)); \
> if (_new_size == 0) _new_size = 1; \
> fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", _new_size, \
> @@ -782,7 +817,7 @@ extern GTY(()) section * darwin_sections[NUM_DARWI
> } while (0)
>
> /* Globalizing directive for a label. */
> -#define GLOBAL_ASM_OP ".globl "
> +#define GLOBAL_ASM_OP "\t.globl "
> #define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label
>
> /* Emit an assembler directive to set visibility for a symbol. Used
> Index: gcc/config/darwin10.h
> ===================================================================
> --- gcc/config/darwin10.h (revision 158296)
> +++ gcc/config/darwin10.h (working copy)
> @@ -18,11 +18,25 @@ You should have received a copy of the GNU General
> along with GCC; see the file COPYING3. If not see
> <http://www.gnu.org/licenses/>. */
>
> +/* FIXME:
> + Hack to work around PR42333: we include the static version of libgcc
> + before lSystem so that we override a buggy implementation of divdc3 */
> +
> +/* Include lm if we've been asked for it and we're on a system for which
> + it makes sense. Note that this spec does not preclude a static version
> + of libm.
> +*/
> +
> /* Fix PR41260 by passing -no_compact_unwind on darwin10 and later until
> unwinder in libSystem is fixed to digest new epilog unwinding notes. */
> -
> +
> #undef LIB_SPEC
> -#define LIB_SPEC "%{!static:-no_compact_unwind -lSystem}"
> +#define LIB_SPEC \
> + "%:version-compare(>= 10.6 mmacosx-version-min= -lgcc) \
> + %{Zlm:%:version-compare(< 10.4 mmacosx-version-min= -lm) } %<Zlm \
> + %{!static: \
> + %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
> + -lSystem}"
>
> /* Unwind labels are no longer required in darwin10. */
>
> Index: gcc/config/darwin9.h
> ===================================================================
> --- gcc/config/darwin9.h (revision 158296)
> +++ gcc/config/darwin9.h (working copy)
> @@ -24,22 +24,19 @@ along with GCC; see the file COPYING3. If not see
> #define DARWIN_PREFER_DWARF
>
> /* Since DWARF2 is default, conditions for running dsymutil are different. */
> -#undef LINK_COMMAND_SPEC
> -#define LINK_COMMAND_SPEC "\
> -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> - %(linker) %l %X %{d} %{s} %{t} %{Z} \
> - %{A} %{e*} %{m} %{r} %{x} \
> - %{o*}%{!o:-o a.out} \
> - %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
> - %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
> - %{fopenmp|ftree-parallelize-loops=*: \
> - %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
> - %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
> - %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
> -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
> - %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
>
> +/* We will default to generation of flat debug files. This is more
> + compatible with the majority of c/l and configury projects.
> + An new c/l switch is invented here (-mdysm) that causes dsymutil
> + to generate a .dSYM directory structure. This latter is the
> + behavior of the XCode toolset on an OSX/Darwin system. */
> +
> +#undef DSYMUTIL_SPEC
> +#define DSYMUTIL_SPEC \
> +"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> + %{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{Zwds:-Wdsymutil} \
> + %{!mdsym:-f } %{o*:%*}%{!o:a.out}}}}}}}}}}}"
> +
> /* libSystem contains unwind information for signal frames. */
> #define DARWIN_LIBSYSTEM_HAS_UNWIND
>
> @@ -50,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
> #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
> do { \
> unsigned HOST_WIDE_INT _new_size = (SIZE); \
> - fprintf ((FILE), ".comm "); \
> + fprintf ((FILE), "\t.comm "); \
> assemble_name ((FILE), (NAME)); \
> if (_new_size == 0) _new_size = 1; \
> fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
>