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) 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)