This 'bug' serves as a placeholder to track progress on porting libunwind (now included with libcxxabi) to darwin8. I've already taken care of some trivial compilations issues in my local branch, such as including >AvailabilityMacros.h>, and preproecssing the UnwindRegister{Save,Restore} asm files. The next hurdle to clear is that _dyld_find_unwind_sections() is unimplemented and unavailable (not even privately) on darwin8. On 10.6+, it is found in mach-o/dyld_priv.h. We need a replacement implementation. Remaining compile error: % make ccache /Volumes/Isolde/builds/LLVM/gcc40-cmake-build/bin/clang++ -O2 -std=c++0x -stdlib=libc++ -Wmismatched-tags -fstrict-aliasing -Wstrict-aliasing=2 -Wsign-conversion -Wshadow -Wconversion -Wunused-variable -Wmissing-field-initializers -Wchar-subscripts -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wnewline-eof -fPIC -fno-common -no-integrated-as -I../include -cxx-isystem /Users/fang/local/src/LLVM-svn/libcxx.git/include -c ../src/Unwind/Unwind_AppleExtras.cpp -o Unwind/Unwind_AppleExtras.o In file included from ../src/Unwind/Unwind_AppleExtras.cpp:12: In file included from ../src/Unwind/DwarfParser.hpp:25: ../src/Unwind/AddressSpace.hpp:227:3: error: unknown type name 'dyld_unwind_sections' dyld_unwind_sections dyldInfo; ^ ../src/Unwind/Unwind_AppleExtras.cpp:188:10: fatal error: 'System/pthread_machdep.h' file not found #include <System/pthread_machdep.h> ^ 2 errors generated. make: *** [Unwind/Unwind_AppleExtras.o] Error 1
For reference, I've found: http://www.opensource.apple.com/source/dyld/dyld-132.13/include/mach-o/dyld_priv.h -- declares struct dyld_unwind_sections http://www.opensource.apple.com/source/dyld/dyld-132.13/src/dyldExceptions.c -- implements _dyld_find_unwind_sections()
or find an alternative way to implement on darwin8 (Unwind/AddressSpace.hpp): bool LocalAddressSpace::findUnwindSections(pint_t, UnwindInfoSections&);
Created attachment 11548 [details] gcc-4.0.1 asm
Created attachment 11549 [details] clang asm of PR17505.cpp
Comment on attachment 11548 [details] gcc-4.0.1 asm wrong bug, sorry
Comment on attachment 11549 [details] clang asm of PR17505.cpp wrong bug, sorry.
Just noting here: until one wishes to build a toolchain from the ground-up (not using system libraries) it's probably not worth pursuing this route. Either have libc++abi link against system's libunwind or use libsupc++ on darwin8. Right now, libc++ linked against libsupc++ on powerpc-darwin8 (with Iain's FDE/EH patches) is showing very promising test results.
Created attachment 13668 [details] patch to use __builtin_trap instead This is the patch I'm using to address the issue on MacPorts.
Comment on attachment 13668 [details] patch to use __builtin_trap instead Sorry, should have been an attachment to #22198.
Created attachment 13670 [details] Fix _dyld_find_unwind_sections fallback implementation It looks like Nick pushed a patch to address the bulk of the specificly reported problem (_dyld_find_unwind_sections being unavailable) in December 2013: commit 034e79a395bf7815fd94ad81d40609aa52f2f34c Author: Nick Kledzik <kledzik@apple.com> Date: Thu Dec 5 00:12:03 2013 +0000 [unwind] remove darwin build dependency on <mach-o/dyld_priv.h> git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@196436 91177308-0d34-0410-b5e6-96231b3b80d8 --- This patch is a followup to fix a bug in that fallback implementation for x86_64.
FWIW, with 22198 and 22200, libunwind is building for Leopard/ppc, so that's a good step forward for anyone trying to get Tiger/ppc working. I doubt I'll make such a step, but some other MacPorts devs have a soft spot for Tiger/ppc and might make additional changes.