Просмотр исходного кода

Fix handling of Apple target triple when checking the ABI lists.

The check-cxx-abilist rule uses TARGET_TRIPLE to determine which
ABI list to check. However the triple on Apple contains the darwin
version which changes frequently, but libc++ doesn't need
different ABI lists for each darwin version.

This patch strips the minor version and patchlevel from TARGET_TRIPLE
before using it to determine the ABI list.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292557 91177308-0d34-0410-b5e6-96231b3b80d8
Eric Fiselier 8 лет назад
Родитель
Сommit
fba0eeeddd

+ 0 - 0
lib/abi/3.9/x86_64-apple-darwin16.0.abilist → lib/abi/3.9/x86_64-apple-darwin16.abilist


+ 0 - 0
lib/abi/4.0/x86_64-apple-darwin16.0.0.abilist → lib/abi/4.0/x86_64-apple-darwin16.abilist


+ 10 - 3
lib/abi/CMakeLists.txt

@@ -1,8 +1,15 @@
 
 
+if (DEFINED TARGET_TRIPLE)
+    # Ignore the minor and patchlevel versions of the darwin
+    # target.
+    string(REGEX REPLACE "darwin16\\.[0-9]\\.[0-9]" "darwin16"
+      GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
+endif()
+
 # Detect if we are building in the same configuration used to generate
 # Detect if we are building in the same configuration used to generate
 # the abilist files.
 # the abilist files.
-if (DEFINED TARGET_TRIPLE
-    AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist"
+if (DEFINED GENERIC_TARGET_TRIPLE
+    AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist"
     AND TARGET cxx_shared
     AND TARGET cxx_shared
     AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
     AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
          (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default"))
          (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default"))
@@ -19,7 +26,7 @@ endif()
 
 
 
 
 if (LIBCXX_HAS_ABILIST_CONFIGURATION)
 if (LIBCXX_HAS_ABILIST_CONFIGURATION)
-    set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist")
+    set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist")
     set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_check/sym_diff.py")
     set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_check/sym_diff.py")
     add_custom_target(check-cxx-abilist
     add_custom_target(check-cxx-abilist
             ${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
             ${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}

+ 0 - 0
lib/abi/x86_64-apple-darwin16.0.0.abilist → lib/abi/x86_64-apple-darwin16.abilist