Skip to content

Commit 4465a62

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 6abae18 commit 4465a62

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
@@ -304,6 +304,23 @@ ${concurrency_libs}
304304
DESTINATION "lib/swift_static/${lowercase_sdk}"
305305
COMPONENT stdlib)
306306
elseif("${sdk}" STREQUAL "WASI")
307+
set(linkfile "${lowercase_sdk}/static-stdlib-args.lnk")
308+
file(WRITE "${SWIFTSTATICLIB_DIR}/${linkfile}" "
309+
-ldl
310+
-latomic
311+
-lswiftWasiPthread
312+
-lswiftCore
313+
-licuuc
314+
-licudata
315+
-lstdc++
316+
-lm
317+
-Xlinker --exclude-libs
318+
-Xlinker ALL")
319+
320+
swift_install_in_component(FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
321+
DESTINATION "lib/swift_static/${lowercase_sdk}"
322+
COMPONENT stdlib)
323+
307324
set(swift_icu_libs_wasi_list)
308325
set(icu_modules UC I18N DATA)
309326
foreach(module IN LISTS icu_modules)

0 commit comments

Comments
 (0)