Skip to content

Commit 6d1cacd

Browse files
kateinoigakukunAnka
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 d9540a9 commit 6d1cacd

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

0 commit comments

Comments
 (0)