Skip to content

Commit ab52855

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 1117b0c commit ab52855

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
@@ -296,6 +296,23 @@ ${concurrency_libs}
296296
DESTINATION "lib/swift_static/${lowercase_sdk}"
297297
COMPONENT stdlib)
298298
elseif("${sdk}" STREQUAL "WASI")
299+
set(linkfile "${lowercase_sdk}/static-stdlib-args.lnk")
300+
file(WRITE "${SWIFTSTATICLIB_DIR}/${linkfile}" "
301+
-ldl
302+
-latomic
303+
-lswiftWasiPthread
304+
-lswiftCore
305+
-licuuc
306+
-licudata
307+
-lstdc++
308+
-lm
309+
-Xlinker --exclude-libs
310+
-Xlinker ALL")
311+
312+
swift_install_in_component(FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
313+
DESTINATION "lib/swift_static/${lowercase_sdk}"
314+
COMPONENT stdlib)
315+
299316
set(swift_icu_libs_wasi_list)
300317
set(icu_modules UC I18N DATA)
301318
foreach(module IN LISTS icu_modules)

0 commit comments

Comments
 (0)