Skip to content

Commit c3b12cd

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 7ae0c75 commit c3b12cd

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
@@ -312,6 +312,23 @@ ${concurrency_libs}
312312
DESTINATION "lib/swift_static/${lowercase_sdk}"
313313
COMPONENT stdlib)
314314
elseif("${sdk}" STREQUAL "WASI")
315+
set(linkfile "${lowercase_sdk}/static-stdlib-args.lnk")
316+
file(WRITE "${SWIFTSTATICLIB_DIR}/${linkfile}" "
317+
-ldl
318+
-latomic
319+
-lswiftWasiPthread
320+
-lswiftCore
321+
-licuuc
322+
-licudata
323+
-lstdc++
324+
-lm
325+
-Xlinker --exclude-libs
326+
-Xlinker ALL")
327+
328+
swift_install_in_component(FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
329+
DESTINATION "lib/swift_static/${lowercase_sdk}"
330+
COMPONENT stdlib)
331+
315332
set(swift_icu_libs_wasi_list)
316333
set(icu_modules UC I18N DATA)
317334
foreach(module IN LISTS icu_modules)

0 commit comments

Comments
 (0)