Skip to content

Commit 28a6317

Browse files
committed
SDK Overlays: Linux: disable explicit module builds
Explicit module builds crash the compiler when building the glibc overlay library. The crash occurs in the Swift driver dependency scanner. It appears to be related to vfs overlays, modulemaps, injected header files, and explicit module builds. This is odd though because the Android builds also have this combination, but work.
1 parent a53b278 commit 28a6317

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Runtimes/Overlay/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ add_compile_definitions(
6464
$<$<BOOL:${SwiftOverlay_ENABLE_BACKDEPLOYMENT_SUPPORT}>:SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT>)
6565

6666
add_compile_options(
67-
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
6867
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
6968
$<$<COMPILE_LANGUAGE:Swift>:-strict-memory-safety>
7069
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-lexical-lifetimes=false>"
@@ -91,6 +90,12 @@ add_link_options($<$<PLATFORM_ID:Linux>:LINKER:-z,defs>)
9190

9291
include(ExperimentalFeatures)
9392

93+
if(NOT LINUX)
94+
# explicit module builds crash the Swift compiler when building the Glibc
95+
# platform overlay https://github.com/swiftlang/swift/issues/84740
96+
add_compile_options($<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>)
97+
endif()
98+
9499
add_subdirectory(clang)
95100
if(ANDROID)
96101
add_subdirectory(Android)

0 commit comments

Comments
 (0)