The unwinder code is a mix of C and C++, but only the C++ code was
compiled with -funwind-tables.  However, the unwinder relies on being
able to unwind through the _Unwind_RaiseException(), which lives in on
of the C files.  And without the .eh_frame section produced by
-funwind-tables, this doesn't work.  We probably didn't notice this
because on amd64 the .eh_frame tables are part of the ABI and will be
generated even if the -funwind-tables option isn't used.  But on arm64
exception handling is broken.  With this fix, the exception handling
regression tests pass.

ok?


Index: lib/libcxxabi/Makefile
===================================================================
RCS file: /cvs/src/lib/libcxxabi/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- lib/libcxxabi/Makefile      16 Feb 2017 02:08:42 -0000      1.6
+++ lib/libcxxabi/Makefile      5 Apr 2017 12:37:49 -0000
@@ -42,6 +42,7 @@ SRCS+=                abort_message.cpp\
 
 CPPFLAGS+=     -I${SHDRDIR} -I${HDRDIR} -I${UHDRDIR}
 CPPFLAGS+=     -D_LIBUNWIND_IS_NATIVE_ONLY
+CFLAGS+=       -nostdlib -nostdinc++ -funwind-tables
 CXXFLAGS+=     -nostdlib -nostdinc++ -funwind-tables
 .if empty(CXXFLAGS:M-std=*)
 CXXFLAGS+=     -std=c++11

Reply via email to