On 10 Oct 2013, at 02:20, David Fang wrote:
I think I took care of this in 10.4-EOL but the change may not have made it to 10.5-EOL (but it should have). I see in the current state that 10.4-EOL's llvm33.patch has the corrected context-related patch. I don't have powerpc-darwin9 to test on, but someone else had tested it for me before. I'm going to blindly sync 10.5-EOL to 10.4- EOL's copy right... now. Please sync 10.5-EOL and try again, and let me know how that works.
Thanks, but it still doesn't work:[ 14%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/ clang_rt.asan_osx_dynamic.dir/asan_mac.cc.o /sw/src/fink.build/llvm33-3.3-1/llvm-3.3.src/projects/compiler-rt/lib/ asan/asan_mac.cc: In function 'void __asan::GetPcSpBp(void*, __sanitizer::uptr*, __sanitizer::uptr*, __sanitizer::uptr*)': /sw/src/fink.build/llvm33-3.3-1/llvm-3.3.src/projects/compiler-rt/lib/ asan/asan_mac.cc:75: error: 'struct __darwin_mcontext' has no member named 'ss' /sw/src/fink.build/llvm33-3.3-1/llvm-3.3.src/projects/compiler-rt/lib/ asan/asan_mac.cc:76: error: 'struct __darwin_mcontext' has no member named 'ss' /sw/src/fink.build/llvm33-3.3-1/llvm-3.3.src/projects/compiler-rt/lib/ asan/asan_mac.cc:78: error: 'struct __darwin_mcontext' has no member named 'ss'
Etc. Looking at the preprocessed output, I've discovered the error only happens while building the ppc64 version of that file. The cause: * the compiler's -dD output showed that __DARWIN_UNIX03 is 0 for the ppc build (# 282 "/usr/include/sys/cdefs.h") and 1 for the ppc64 build (# 277 "/usr/include/sys/cdefs.h"). As a result, the ppc version uses "ss" and the ppc64 uses "__ss" as the mem state name in the system headers. * __DARWIN_VERSION__ is defined as "((MAC_OS_X_VERSION_MIN_REQUIRED - MAC_OS_X_VERSION_10_0)/10 +4)", and MAC_OS_X_VERSION_MIN_REQUIRED is defined as __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ in both cases comes from the compiler's built-in defines, and is set to 1040 *in both cases*.
The log confirms that the file is built with -mmacosx-version- min=10.4. As a result, __DARWIN_VERSION__ is 8 even when building on 10.5, which cause the following macro to always evaluate to false:
// adjusting for different struct member names on darwin8 // see /usr/include/i386/_structs.h on darwin9+ // see /usr/include/i386/ucontext.h on darwin8#if __DARWIN_VERSION__ && (!__DARWIN_UNIX03 || (__DARWIN_VERSION__ < 9))
#define STATE_MEM ss #else #define STATE_MEM __ss #endifI'm not sure where the decision is made to specify -mmacosx-version- min=10.4. Alternatively, maybe the decision to base __DARWIN_VERSION__ on MAC_OS_X_VERSION_MIN_REQUIRED is not a good idea. After all, the minimally supported Mac OS X version does not have to match the SDK/ current OS version. I understand where it comes from though, because there is no easy way to distinguish between the 10.4u and 10.5 SDKs.
A possible way could be to check for _PPC_UCONTEXT_H_ or _I386_UCONTEXT_H_. That macro is defined when compiling against the 10.4 SDK but not when compiling against the 10.5 SDK, because 10.4 uses {ppc,i386}/ucontext.h, while 10.5 instead has {ppc,i386}/ _structs.h. I've attached a modified version of llvm33.patch that uses this technique. Additionally, I also had to apply the X86_THREAD_MEM() macro on ppc64 (so I renamed it to THREAD_MEM()).
My build using this patch isn't finished yet and I can't check the outcome until Monday, but it seems to work fine (at least asan has built successfully already). I hope it also still works on 10.4 (and on x86/x86_64).
JonasPS: the ccache detection in llvm33.info seems to be broken. I have ccache installed via fink (/sw/bin/ccache exists), but the build process doesn't use it (I understand you normally have to install the ccache-default package for fink to use it, but the llvm build script seems to have special detection for it that should work even when ccache-default isn't installed) PS2: since 10.5 is no longer supported by the Fink project, should I take fink-users out of CC?
llvm33.patch.bz2
Description: BZip2 compressed data
------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________ Fink-users mailing list Fink-users@lists.sourceforge.net List archive: http://news.gmane.org/gmane.os.macosx.fink.user Subscription management: https://lists.sourceforge.net/lists/listinfo/fink-users