This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR41260 link with -no_compact_unwind on darwin10 and later
- From: Peter O'Gorman <peter at pogma dot com>
- To: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, mrs at apple dot com
- Date: Mon, 21 Sep 2009 09:12:57 -0500
- Subject: Re: [PATCH] PR41260 link with -no_compact_unwind on darwin10 and later
- References: <20090920223606.GA20606@bromo.med.uc.edu>
Jack Howarth wrote:
> The exception handling tests failing on darwin10 since r147995
> are due to the new dwarf unwinding information being added
> to describe the function epilog. This breaks the unwinding
> under darwin10 since the unwinder used is always from libSystem
> (based on that from libgcc in gcc 4.2.1) that doesn't expect
> this additional information. The attached patch takes the second
> option of passing -no_compact_unwind onto the linkage for darwin10
> or later. This eliminates all of the regressions from r147995...
>
> http://gcc.gnu.org/ml/gcc-testresults/2009-09/msg01761.html
>
> and more. While we might be able to use the alternate approach
> of suppressing the additional dwarf unwinding information, I fear
> that there are other incompatibilities left in the compact
> unwinding when it is generated by FSF gcc 4.5 but run with an
> unwinder based on gcc 4.2.1. Hence the additional regressions
> disappearing when -no_compact_unwind is used.
> There still is the question of whether this change should
> be extended to all darwin and not just darwin10 or later? The
> current patch fixes darwin10 but binaries built with gcc 4.5
> on darwin9 and run under darwin10 will still have the offending
> dwarf unwinding information present.
> Okay for gcc trunk?
Jack,
I realize that this patch is a one-liner, and that you put the effort
into testing it, but it would have been polite to have put one of "Peter
O'Gorman", "pogma", or "http://gcc.gnu.org/ml/gcc/2009-09/msg00343.html"
somewhere in this patch submission.
As for darwin9 and earlier, the static linker pre-10.6 did not do
anything with dwarf unwind information, so there is nothing to do, no
compact unwind info will be created, so the unwinder will "fallback and
use the slow dwarf unwind info" (to quote Nick Kledzik).
If this patch is approved, it should probably be reverted if the epilog
unwind info is no longer output for darwin.
Peter
Note:
The -no_compact_unwind linker option is not documented, the ld man page
does document -warn_compact_unwind, which gives some information on the
compact unwinding section added by the linker:
When producing a final linked image, the linker processes the
__eh_frame section and produces an __unwind_info section.
Most FDE entries in the __eh_frame can be represented by a
32-bit value in the __unwind_info section. The option issues
a warning for any function whose FDE cannot be expressed in
the compact unwind format.
> Jack
>
>
> 2009-09-20 Jack Howarth <howarth@bromo.med.uc.edu>
>
> PR middle-end/41260
> * gcc/config/darwin.h: Pass -no_compact_unwind to linker
> on darwin10 and later since it always uses the unwinder in
> libSystem which is derived from the gcc 4.2.1 unwinder.
>
>
> Index: gcc/config/darwin.h
> ===================================================================
> --- gcc/config/darwin.h (revision 151908)
> +++ gcc/config/darwin.h (working copy)
> @@ -372,7 +372,9 @@
>
> /* Machine dependent libraries. */
>
> -#define LIB_SPEC "%{!static:-lSystem}"
> +#define LIB_SPEC "%{!static:\
> + %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
> + -lSystem}"
>
> /* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
> libraries to link against, and by not linking against libgcc_s on
>
--
Peter O'Gorman
http://pogma.com