Skip to content

Commit 27a641c

Browse files
kateinoigakukunrunner
authored andcommitted
[wasm][stdlib] Add static-stdlib-args.lnk generation for WASI
But static-stdlib-args.lnk is actually not used by WebAssembly driver toolchain now because we don't support non-executable linking for now.
1 parent 32339e2 commit 27a641c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,23 @@ ${concurrency_libs}
308308
DESTINATION "lib/swift_static/${lowercase_sdk}"
309309
COMPONENT stdlib)
310310
elseif("${sdk}" STREQUAL "WASI")
311+
set(linkfile "${lowercase_sdk}/static-stdlib-args.lnk")
312+
file(WRITE "${SWIFTSTATICLIB_DIR}/${linkfile}" "
313+
-ldl
314+
-latomic
315+
-lswiftWasiPthread
316+
-lswiftCore
317+
-licuuc
318+
-licudata
319+
-lstdc++
320+
-lm
321+
-Xlinker --exclude-libs
322+
-Xlinker ALL")
323+
324+
swift_install_in_component(FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
325+
DESTINATION "lib/swift_static/${lowercase_sdk}"
326+
COMPONENT stdlib)
327+
311328
set(swift_icu_libs_wasi_list)
312329
set(icu_modules UC I18N DATA)
313330
foreach(module IN LISTS icu_modules)

0 commit comments

Comments
 (0)