#if defined(__APPLE__)
#define EXHAUSTED _rust_stack_exhausted
-#elif defined(__linux__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
#define EXHAUSTED rust_stack_exhausted@PLT
#else
#define EXHAUSTED rust_stack_exhausted
#endif
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
.hidden MORESTACK
#else
#if defined(__APPLE__)
// bytes greater than a normal frame, to allow the unwinder
// to skip the partial frame of the original function.
.cfi_def_cfa_offset 24
+
+#if defined(__APPLE__)
+ // The pattern of the return address being saved twice to the same location
+ // tells the OS X linker that it should not attempt to convert the DWARF
+ // unwind information to the compact format.
+ .cfi_offset %rip, -8
+ .cfi_offset %rip, -8
+#endif
+
// %rbp is -24 bytes from the CFA
.cfi_offset %rbp, -24
movq %rsp, %rbp