Skip to content

Commit 1f0550f

Browse files
committed
[build] Set language flag for C++ on OpenBSD.
See swiftlang#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.
1 parent 8c42386 commit 1f0550f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ set(SWIFT_RUNTIME_CORE_LINK_FLAGS "${SWIFT_RUNTIME_LINK_FLAGS}")
2929

3030
if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
3131
list(APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-mcmodel=large")
32+
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
33+
list(APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-xc++")
3234
endif()
3335

3436
# C++ code in the runtime and standard library should generally avoid

0 commit comments

Comments
 (0)