https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80556
--- Comment #22 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Tristan Gingold from comment #21) > On 11/05/2017 09:44, iains at gcc dot gnu.org wrote: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80556 > > > > --- Comment #20 from Iain Sandoe <iains at gcc dot gnu.org> --- > > (In reply to Tristan Gingold from comment #19) > >> On 10/05/2017 18:04, dominiq at lps dot ens.fr wrote: > >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80556 > >> > >>> In the commit r247301 I see in gcc/ada/gcc-interface/Make-lang.in > >>> > >>> --- trunk/gcc/ada/gcc-interface/Make-lang.in 2017/04/27 09:44:28 > >>> 247300 > >>> +++ trunk/gcc/ada/gcc-interface/Make-lang.in 2017/04/27 09:48:45 > >>> 247301 > >>> @@ -99,6 +99,8 @@ > >>> ada-warn = $(ADA_CFLAGS) $(filter-out -pedantic, $(STRICT_WARN)) > >>> # Unresolved warnings in specific files. > >>> ada/adaint.o-warn = -Wno-error > >>> +# For unwind-pe.h > >>> +CFLAGS-ada/raise-gcc.o += -I$(srcdir)/../libgcc -Iinclude > >>> > >>> ada/%.o: ada/gcc-interface/%.c > >>> $(COMPILE) $< > >>> > >>> Isn't this wrong for darwin? > >> > >> Why ? > >> > >> The header unwind-pe.h is needed for the personality routine. > > > > What we need to do is to remove the (use of) libgcc_s and not use libgcc_eh > > (static-libgcc) for Darwin > 10, since the unwinder is now in > > usr/lib/system/libunwind.dylib. > > > > Needs two chunks (1) move the content for TLS emulation somewhere else, > > since > > that's a reason to need libgcc_s (2) adjust the use of libgcc for Darwin > > > 10 > > to not include libgcc_eh for -static-libgcc. I have some patches for gcc-5 > > and > > 6 that do this, will forward-port them. > > Great! .. but might not be 'this week' ;-) > > I'm a little surprised that we need explicit -static-libstdc++ for gnat, the > > rest of the compiler already handles this? > > We just need to remove -static-libgcc but keep -static-libstdc++ OK. So looking at the breaking rev. (and to check I've understood correctly) - the change switches gnat from using setjmp/longjmp to using DWARF unwinding (and thus exposes the incompatibility)? In the short-term, what ought to work is to ensure that -lSystem appears before any -lgcc on the link line (so that the correct unwinder is used), and to remove -static-libgcc. TBH static-libgcc should actually work unless gnat is now pulling in any other system libraries which cause two unwinders to be present - I guess it might be? (probably, as an aside, we ought to look at putting libstdc++ on top of libc++abi instead of libsupc++ - but that's on the TODO, no patches yet).