[PATCH] D58598: [CMake] Support alternative C++ ABI library

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 12:14:42 PST 2019


phosek updated this revision to Diff 188236.
phosek marked 6 inline comments as done.

Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58598/new/

https://reviews.llvm.org/D58598

Files:
  CMakeLists.txt
  MultiSource/Applications/obsequi/CMakeLists.txt


Index: MultiSource/Applications/obsequi/CMakeLists.txt
===================================================================
--- MultiSource/Applications/obsequi/CMakeLists.txt
+++ MultiSource/Applications/obsequi/CMakeLists.txt
@@ -6,7 +6,7 @@
   list(APPEND CPPFLAGS -DHASHCODEBITS=23)
 endif()
 if(NOT "${ARCH}" STREQUAL "PowerPC")
-  list(APPEND LDFLAGS -lsupc++)
+  list(APPEND LDFLAGS -l${TEST_SUITE_CXX_ABI_LIBNAME})
 endif()
 set(RUN_OPTIONS < input)
 llvm_multisource(Obsequi)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -155,6 +155,21 @@
 set(CMAKE_EXE_LINKER_FLAGS
     "${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_EXTRA_EXE_LINKER_FLAGS}")
 
+# This is either directly the C++ ABI library or the full C++ library
+# which pulls in the ABI transitively.
+set(TEST_SUITE_CXX_ABI "default" CACHE STRING "Specify C++ ABI library to use.")
+set(CXXABIS "none default libstdc++ libsupc++ libc++ libc++abi")
+set_property(CACHE TEST_SUITE_CXX_ABI PROPERTY STRINGS "${CXXABIS}")
+if (TEST_SUITE_CXX_ABI STREQUAL "default")
+  if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Fuchsia")
+    set(TEST_SUITE_CXX_ABI_LIBNAME "c++abi")
+  else()
+    set(TEST_SUITE_CXX_ABI_LIBNAME "supc++")
+  endif()
+else()
+  STRING(REGEX REPLACE "^lib" "" TEST_SUITE_CXX_ABI_LIBNAME ${TEST_SUITE_CXX_ABI})
+endif()
+
 include(TestSuite)
 include(SingleMultiSource)
 find_package(TCL)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58598.188236.patch
Type: text/x-patch
Size: 1451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190225/cef2122e/attachment.bin>


More information about the llvm-commits mailing list