Skip to content

OS X: ld: warning: could not create compact unwind for _ffi_call_unix64

The OS X 10.6 linker now defaults to creating compact unwinds, which is a good thing, however the unwind info for _ffi_call_unix64 can't be represented in the compact format. This warning is issued any time ghc links, and many tests in the test suite fail due to the extra output:

ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame

Possible solutions:

  • suppress the warning in ld; unfortunately this does not seem to be possible, since the only applicable option is -warn_compact_unwind which enables the already enabled-by-default warnings
  • suppress the warning in ghc; I haven't really looked into this, but one could filter the text output from the linker to remove the warning
  • entirely disable compact unwinds using -no_compact_unwind; this flag is undocumented, so I'm not certain about what it really does
  • patch _ffi_call_unix64 in libffi to make it compatible with compact unwinds

Info about compact unwinds in OS X 10.6 is somewhat scarce, but man unwinddump has a bit:

When a C++ (or x86_64 Objective-C) exception is thrown, the runtime must unwind the
stack looking for some function to catch the exception.  Traditionally, the unwind
information is stored in the __TEXT/__eh_frame section of each executable as Dwarf
CFI (call frame information).  Beginning in Mac OS X 10.6, the unwind information is
also encoded in the __TEXT/__unwind_info section using a two-level lookup table of
compact unwind encodings.

The unwinddump tool displays the content of the __TEXT/__unwind_info section.

Relevant discussions:

http://groups.google.com/group/llvm-dev/browse_thread/thread/8baba4531a9feb07/139c9eba3525ebe http://groups.google.com/group/darwin-dev/browse_thread/thread/962f74bde0efaae4/cfb63dfb3ac34ce1

Trac metadata
Trac field Value
Version 7.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information