]> git.lizzy.rs Git - rust.git/commitdiff
rustc: Don't emit compact unwind info on mac
authorBrian Anderson <banderson@mozilla.com>
Sun, 18 Dec 2011 08:41:26 +0000 (00:41 -0800)
committerBrian Anderson <banderson@mozilla.com>
Sun, 18 Dec 2011 08:42:37 +0000 (00:42 -0800)
It's not compatible with the subtlety of __morestack

mk/platform.mk
src/comp/back/link.rs

index c4cce8c94388f4087e43a80777dcf09f697bca4f..da3727c67eb524d3abfd3e6f7d6f173fbb8069db 100644 (file)
@@ -76,7 +76,7 @@ ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
   CFG_LIB_GLOB=lib$(1)-*.dylib
   CFG_UNIXY := 1
   CFG_LDENV := DYLD_LIBRARY_PATH
-  CFG_GCCISH_LINK_FLAGS += -dynamiclib -lpthread -framework CoreServices
+  CFG_GCCISH_LINK_FLAGS += -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
   CFG_GCCISH_DEF_FLAG := -Wl,-exported_symbols_list,
   # Darwin has a very blurry notion of "64 bit", and claims it's running
   # "on an i386" when the whole userspace is 64-bit and the compiler
index 9afcc23376a50411b222fae02f7506c69629c5e3..eadb7eba5913cc5a2e42e2ce1f5bc178823cc602 100644 (file)
@@ -657,6 +657,14 @@ fn rmext(filename: str) -> str {
         gcc_args += ["-lrt", "-ldl"];
     }
 
+    // OS X 10.6 introduced 'compact unwind info', which is produced by the
+    // linker from the dwarf unwind info. Unfortunately, it does not seem to
+    // understand how to unwind our __morestack frame, so we have to turn it
+    // off. This has impacted some other projects like GHC.
+    if sess.get_targ_cfg().os == session::os_macos {
+        gcc_args += ["-Wl,-no_compact_unwind"];
+    }
+
     // Stack growth requires statically linking a __morestack function
     gcc_args += ["-lmorestack"];