From 1f0550f138c12fa69f41682a8cf9b212909f77d6 Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Sun, 22 Mar 2020 16:36:28 -0400 Subject: [PATCH] [build] Set language flag for C++ on OpenBSD. See #12510 and SR-3635 for some context; OpenBSD exhibits the same problem listed here. Without this, the build fails with an undefined symbol error for __gnustep_objcxx_personality_v0. Per commentary on the aforementioned PR, forcing the language to be interpreted as C++ solves the problem. There might be something different we can do here to diagnose and fix this, but this is the simplest solution to get the build working and enabling this for all C++ files should be tautologous and therefore harmless. --- stdlib/public/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/public/CMakeLists.txt b/stdlib/public/CMakeLists.txt index e8d5da6490b76..986a49b67d061 100644 --- a/stdlib/public/CMakeLists.txt +++ b/stdlib/public/CMakeLists.txt @@ -29,6 +29,8 @@ set(SWIFT_RUNTIME_CORE_LINK_FLAGS "${SWIFT_RUNTIME_LINK_FLAGS}") if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN") list(APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-mcmodel=large") +elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + list(APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-xc++") endif() # C++ code in the runtime and standard library should generally avoid