From 00f16283cf12c53c2626d21fb534f9422500f0f1 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 14 Apr 2009 22:31:59 +0000 Subject: [PATCH] Mac OS X 10.6 and above do not use key manager to register EH frames. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69090 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/JIT/JIT.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 0490343b861..57201493e07 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -86,7 +86,13 @@ namespace llvm { extern "C" void __register_frame(void*); -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 +# define USE_KEYMGR 1 +#else +# define USE_KEYMGR 0 +#endif + +#if USE_KEYMGR namespace { @@ -224,7 +230,7 @@ JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, // Register routine for informing unwinding runtime about new EH frames #if defined(__GNUC__) && !defined(__ARM_EABI__) -#if defined(__APPLE__) +#if USE_KEYMGR struct LibgccObjectInfo* LOI = (struct LibgccObjectInfo*) _keymgr_get_and_lock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST);