-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Enable _Concurrency for Embedded Swift with WASI
#79292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
32da3a5
55f047b
d42a8b8
635ef6a
4336eb6
375187d
5a3626b
8a11cda
e178bf8
431063b
63d57f4
a3e218d
ee5d8d0
f1b616f
a05560b
b9de71b
59fbab8
220ab30
5973bc8
cef01c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,6 +224,11 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "OFF") | |
| elseif(SWIFT_HOST_VARIANT STREQUAL "windows") # For now, don't build embedded Concurrency on Windows | ||
| set(SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENCY FALSE) | ||
| endif() | ||
|
|
||
| message(STATUS "SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB is ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB}") | ||
| message(STATUS "SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENCY is ${SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENCY}") | ||
| message(STATUS "EMBEDDED_STDLIB_TARGET_TRIPLES is ${EMBEDDED_STDLIB_TARGET_TRIPLES}") | ||
|
|
||
| if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENCY) | ||
| add_custom_target(embedded-concurrency) | ||
| add_dependencies(embedded-libraries embedded-concurrency) | ||
|
|
@@ -245,13 +250,13 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC | |
| list(GET list 2 triple) | ||
|
|
||
| if (SWIFT_HOST_VARIANT STREQUAL "linux") | ||
| if(NOT "${mod}" MATCHES "-linux-gnu$") | ||
| if((NOT "${mod}" MATCHES "-linux-gnu$") AND (NOT "${mod}" MATCHES "-wasip1")) | ||
| continue() | ||
| endif() | ||
| set(extra_c_compile_flags) | ||
| set(extra_swift_compile_flags) | ||
| elseif (SWIFT_HOST_VARIANT STREQUAL "macosx") | ||
| if(NOT "${mod}" MATCHES "-macos$") | ||
| if((NOT "${mod}" MATCHES "-macos$") AND (NOT "${mod}" MATCHES "-wasip1")) | ||
| continue() | ||
| endif() | ||
| if("${mod}" MATCHES "riscv") | ||
|
|
@@ -260,8 +265,25 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC | |
| if("${mod}" MATCHES "armv6m") | ||
| continue() | ||
| endif() | ||
| set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding -stdlib=libc++) | ||
| set(extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding) | ||
|
|
||
| if("${mod}" MATCHES "-macos$") | ||
| set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding -stdlib=libc++) | ||
| set(extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding) | ||
|
Comment on lines
+265
to
+266
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's unclear to me. Keeping as is, changing it doesn't seem relevant to this PR.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are needed for -apple-none-macho but shouldn't be needed otherwise. the |
||
| endif() | ||
|
|
||
| elseif (SWIFT_HOST_VARIANT STREQUAL "wasi") | ||
| message(STATUS "SWIFT_WASI_SYSROOT_PATH is ${SWIFT_WASI_SYSROOT_PATH}") | ||
| message(STATUS "mod is ${mod}") | ||
MaxDesiatov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if("${mod}" MATCHES "-wasip1") | ||
| set(extra_c_compile_flags "-I${SWIFT_WASI_SYSROOT_PATH}/include/c++/v1") | ||
| if(${SWIFT_WASI_SYSROOT_PATH} MATCHES "threads") | ||
| list(APPEND extra_c_compile_flags "-I${SWIFT_WASI_SYSROOT_PATH}/include/wasm32-wasip1-threads") | ||
| else() | ||
| list(APPEND extra_c_compile_flags "-I${SWIFT_WASI_SYSROOT_PATH}/include/wasm32-wasi") | ||
| endif() | ||
MaxDesiatov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| endif() | ||
|
|
||
| message(STATUS "extra_c_compile_flags is ${extra_c_compile_flags}") | ||
MaxDesiatov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| endif() | ||
|
|
||
| set(SWIFT_SDK_embedded_THREADING_PACKAGE none) | ||
|
|
@@ -304,7 +326,10 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC | |
| COMPONENT "stdlib" | ||
| PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE | ||
| ) | ||
| set_property(TARGET embedded-concurrency-${mod} PROPERTY OSX_ARCHITECTURES "${arch}") | ||
|
|
||
| if(NOT "${arch}" MATCHES "wasm32") | ||
| set_property(TARGET embedded-concurrency-${mod} PROPERTY OSX_ARCHITECTURES "${arch}") | ||
| endif() | ||
| add_dependencies(embedded-concurrency embedded-concurrency-${mod}) | ||
|
|
||
| # lib/swift/embedded/<triple>/libswift_ConcurrencyDefaultExecutor.a | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.