diff --git a/deps/unwind.mk b/deps/unwind.mk index 351f9b3df745f..c51adfe63dce0 100644 --- a/deps/unwind.mk +++ b/deps/unwind.mk @@ -27,7 +27,7 @@ $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-static-arm.patch-applied: $(SRCCAC $(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-static-arm.patch-applied mkdir -p $(dir $@) cd $(dir $@) && \ - $(dir $<)/configure $(CONFIGURE_COMMON) CPPFLAGS="$(CPPFLAGS) $(LIBUNWIND_CPPFLAGS)" CFLAGS="$(CFLAGS) $(LIBUNWIND_CFLAGS)" --disable-shared --disable-minidebuginfo --disable-tests + $(dir $<)/configure $(CONFIGURE_COMMON) CPPFLAGS="$(CPPFLAGS) $(LIBUNWIND_CPPFLAGS)" CFLAGS="$(CFLAGS) $(LIBUNWIND_CFLAGS)" --enable-shared --disable-minidebuginfo --disable-tests echo 1 > $@ $(BUILDDIR)/libunwind-$(UNWIND_VER)/build-compiled: $(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured diff --git a/src/task.c b/src/task.c index 5460e79618ba6..345176a98dd5f 100644 --- a/src/task.c +++ b/src/task.c @@ -807,10 +807,25 @@ STATIC_OR_JS void NOINLINE JL_NORETURN start_task(void) { #ifdef _OS_WINDOWS_ #if defined(_CPU_X86_64_) - // install the unhandled exception hanlder at the top of our stack + // install the unhandled exception handler at the top of our stack // to call directly into our personality handler asm volatile ("\t.seh_handler __julia_personality, @except\n\t.text"); #endif +#else + // wipe out the call-stack unwind capability beyond this function + // (we are noreturn, so it is not a total lie) +#if defined(_CPU_X86_64_) + // per nongnu libunwind: "x86_64 ABI specifies that end of call-chain is marked with a NULL RBP or undefined return address" + // so we do all 3, to be extra certain of it + asm volatile ("\t.cfi_undefined rip"); + asm volatile ("\t.cfi_undefined rbp"); + asm volatile ("\t.cfi_return_column rbp"); +#else + // per nongnu libunwind: "DWARF spec says undefined return address location means end of stack" + // we use whatever happens to be register 1 on this platform for this + asm volatile ("\t.cfi_undefined 1"); + asm volatile ("\t.cfi_return_column 1"); +#endif #endif // this runs the first time we switch to a task