[asterisk-scf-commits] asterisk-scf/release/cmake.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Mar 15 14:20:27 CDT 2012


branch "master" has been updated
       via  346da67a06b49d990804162dce91de2144d96e8b (commit)
       via  9de9affbbadac633990c95a2496bd08aee534ba3 (commit)
      from  57bbeebe490f4ac54f9040a9ec440e8194c8d25d (commit)

Summary of changes:
 AsteriskSCF.cmake |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 346da67a06b49d990804162dce91de2144d96e8b
Author: David M. Lee <dlee at digium.com>
Date:   Thu Mar 15 13:19:01 2012 -0500

    Fix symbol resolution problems on OS X.
    
    On OS X, if an object is passed between modules, it would have
    unexpected RTTI, which would cause dynamic_cast to fail. Adding the
    -flat_namespace flag allows dlopen's RTLD_GLOBAL flag to work properly.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0958824..ea4fe3a 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -381,6 +381,15 @@ function(astscf_project NAME ICE_VERSION)
     endif()
   endif()
 
+  # OS X has a two level namespace, which resolves symbols differently than
+  # other OS's. To allow components to pass objects within the same IceBox,
+  # -flat_namespace must be set. See https://wiki.asterisk.org/wiki/x/HQsiAQ
+  # for details.
+  if(APPLE)
+    list(APPEND c_flags -flat_namespace)
+    list(APPEND cxx_flags -flat_namespace)
+  endif()
+
   if(CMAKE_COMPILER_IS_GNUCC)
     list(APPEND c_flags_debug "-Wall" "-g3")
     list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")

commit 9de9affbbadac633990c95a2496bd08aee534ba3
Author: David M. Lee <dlee at digium.com>
Date:   Thu Oct 20 16:43:17 2011 -0500

    Fix for OS X.
    
    Apple's version of GCC doesn't support --no-undefined. Unfortunately,
    there's not a straightforward way to test for the flag, so if (NOT
    APPLE) it is.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index a2e2b8a..0958824 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -395,8 +395,10 @@ function(astscf_project NAME ICE_VERSION)
     # into the object have been satisfied... which means that unresolved
     # symbols won't be found until runtime. This flag tells the linker
     # to do that resolution at link time, and report an error if a symbol
-    # is unresolved.
-    list(APPEND cxx_flags_debug "-Wl,--no-undefined")
+    # is unresolved. This flag not supported by the OS X linker.
+    if(NOT APPLE)
+      list(APPEND cxx_flags_debug "-Wl,--no-undefined")
+    endif()
     include(CheckCXXCompilerFlag)
     CHECK_CXX_COMPILER_FLAG(-Wlogical-op HAVE_W_LOGICAL_OP)
     if(HAVE_W_LOGICAL_OP)

-----------------------------------------------------------------------


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list