Skip to content

Commit 7db7da0

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 facd074 commit 7db7da0

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

0 commit comments

Comments
 (0)