diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2018-08-22 11:58:43 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2018-08-22 11:58:43 +0000 |
commit | a49c064e407df3d39776241f2c08b14e6affde1e (patch) | |
tree | 46b0d7e2ac835e54b397263c266ab174ab46aeeb /libgcc | |
parent | 36bd86fa510ec16c32d7d7134b5897787a3f54b2 (diff) | |
download | gcc-a49c064e407df3d39776241f2c08b14e6affde1e.zip gcc-a49c064e407df3d39776241f2c08b14e6affde1e.tar.gz gcc-a49c064e407df3d39776241f2c08b14e6affde1e.tar.bz2 |
Move Darwin10 unwinder fix to a crt shim.
gcc/
* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the
Darwin10-specific unwinder-shim.
* config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove.
* config/rs6000/darwin.h (DARWIN_CRT1_SPEC, DARWIN_DYLIB1_SPEC):
New to cater for Darwin10 Rosetta.
libgcc/
* config/unwind-dw2-fde-darwin.c
(_darwin10_Unwind_FindEnclosingFunction): move from here ...
* config/darwin10-unwind-find-enc-func.c: … to here.
* config/t-darwin: Build Darwin10 unwinder shim crt.
* libgcc/config.host: Add the Darwin10 unwinder shim.
From-SVN: r263765
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 8 | ||||
-rw-r--r-- | libgcc/config/darwin10-unwind-find-enc-func.c | 13 | ||||
-rw-r--r-- | libgcc/config/t-darwin | 4 | ||||
-rw-r--r-- | libgcc/config/unwind-dw2-fde-darwin.c | 13 |
4 files changed, 25 insertions, 13 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 1cfba4c..d003fd5 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,11 @@ +2018-08-22 Iain Sandoe <iain@sandoe.co.uk> + + * config/unwind-dw2-fde-darwin.c + (_darwin10_Unwind_FindEnclosingFunction): move from here ... + * config/darwin10-unwind-find-enc-func.c: … to here. + * config/t-darwin: Build Darwin10 unwinder shim crt. + * libgcc/config.host: Add the Darwin10 unwinder shim. + 2018-08-21 Rasmus Villemoes <rv@rasmusvillemoes.dk> * config.host: Add crtbegin.o and crtend.o for diff --git a/libgcc/config/darwin10-unwind-find-enc-func.c b/libgcc/config/darwin10-unwind-find-enc-func.c new file mode 100644 index 0000000..67c4375 --- /dev/null +++ b/libgcc/config/darwin10-unwind-find-enc-func.c @@ -0,0 +1,13 @@ +#include "tconfig.h" +#include "tsystem.h" +#include "unwind-dw2-fde.h" + +void * +_darwin10_Unwind_FindEnclosingFunction (void *pc) +{ + struct dwarf_eh_bases bases; + const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases); + if (fde) + return bases.func; + return NULL; +} diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin index 13ca6ed..8340ea2 100644 --- a/libgcc/config/t-darwin +++ b/libgcc/config/t-darwin @@ -20,3 +20,7 @@ HOST_LIBGCC2_CFLAGS += -pipe # Use unwind-dw2-fde-darwin LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + +# Patch to __Unwind_Find_Enclosing_Function for Darwin10. +d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c + $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -mmacosx-version-min=10.6 -c $< diff --git a/libgcc/config/unwind-dw2-fde-darwin.c b/libgcc/config/unwind-dw2-fde-darwin.c index 6e2d0d6..c919de9 100644 --- a/libgcc/config/unwind-dw2-fde-darwin.c +++ b/libgcc/config/unwind-dw2-fde-darwin.c @@ -273,16 +273,3 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) the_obj_info); return ret; } - -void * -_darwin10_Unwind_FindEnclosingFunction (void *pc ATTRIBUTE_UNUSED) -{ -#if __MACH__ && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060) - struct dwarf_eh_bases bases; - const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases); - if (fde) - return bases.func; -#endif - return NULL; -} - |