Skip to content

Commit

Permalink
rustc: Don't emit compact unwind info on mac
Browse files Browse the repository at this point in the history
It's not compatible with the subtlety of __morestack
  • Loading branch information
brson committed Dec 18, 2011
1 parent 68f4849 commit cb5f636
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/comp/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ fn link_binary(sess: session::session,
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"];

Expand Down

0 comments on commit cb5f636

Please sign in to comment.