Impossible to build dyld-132.13: libunwind missing

Originator:aidan
Number:rdar://8074387 Date Originated:09-Jun-2010 06:14 PM
Status:Duplicate/7216959 Resolved:
Product:Mac OS X Product Version:10.6.3
Classification:Other Bug Reproducible:N/A
 
Summary:
The Mac OS X 10.6.3 source release at http://opensource.apple.com/release/mac-os-x-1063/ includes the dyld project at version 132.13, but it cannot be built due to a missing dependency on libunwind, the sources for which do not appear to be available.

Steps to Reproduce:
1. Fetch http://opensource.apple.com/tarballs/dyld/dyld-132.13.tar.gz.
2. Try to build it.

Expected Results:
It should be possible to build dyld as distributed.

Actual Results:
Due to missing headers from libunwind, dyld cannot be built as is.

Regression:
dyld as of 10.5.8[1] did not require libunwind and hence built as expected. This is no longer the behaviour as of 10.6.

Notes:
[1]: http://opensource.apple.com/source/dyld/dyld-97.1/

Comments

libunwind now available

here: http://www.opensource.apple.com/tarballs/libunwind/ And in older versions of lldb SVN tree.

The exception code in question used is present under src/dyldExceptions.c Change #if __i386 || x86_64 || ppc to #if 0. It now compiles for the libgcc_eh archive instead of Apple's custom libUnwind. There is one more change needed for getting the library used correctly: In dyld.xcodeproj/project.pbxproj change the following: EXCEPTION_LIB_i386 = /usr/local/lib/dyld/libunwind.a; EXCEPTION_LIB_ppc = /usr/local/lib/dyld/libunwind.a; EXCEPTION_LIB_x86_64 = /usr/local/lib/dyld/libunwind.a; To: EXCEPTION_LIB_i386 = "-lgcc_eh"; EXCEPTION_LIB_ppc = "-lgcc_eh"; EXCEPTION_LIB_x86_64 = "-lgcc_eh"; 2 times will this need to be done (for Release and Debug target) This fixes the issue for libunwind.

There is one more missing part of the puzzle though. libCoreSymbolication is not released by Apple (the static libraries nor headers). I couldn't get it to build with CoreSymbolication support enabled.

--- The fix for CoreSymbolication not available --- open src/Imageloader.h Look for

define CORESYMBOLICATION_SUPPORT (__i386 || x86_64__)

and change it to:

define CORESYMBOLICATION_SUPPORT 0

In dyld.xcodeproj/project.pbxproj search and remove the following line (2x) /usr/local/lib/libCoreSymbolicationSharedWithDyld.a, If you now build dyld, it will build...

libunwind

The libunwind project is NOT an Apple project. The source and compilation is available at:

http://www.nongnu.org/libunwind/

By joseph.cohen at June 15, 2010, 7:22 a.m. (reply...)

I'm well aware of the fact that libunwind did not originate from within Apple. That said, Apple are known to release their modifications to open source projects on their website, even if they are not legally obliged to do so. Case in point: the nontrivial number of MIT-licensed projects hosted on opensource.apple.com. The dyld project will not compile against the generic libunwind library, on account of additional Apple-specific functionality.

Actually, Apple's libunwind has nothing to do with the other libunwind project. It is also now open source in the lldb source repository (though you might need to do a bit of tweaking to get it to build).


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!