-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
ICU-22838 Add WebAssembly/WASI cross-compilation support #3067
Open
kateinoigakukun
wants to merge
1
commit into
unicode-org:main
Choose a base branch
from
kateinoigakukun:yt/wasi-support-ICU-22838
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ICU-22838 Add WebAssembly/WASI cross-compilation support #3067
kateinoigakukun
wants to merge
1
commit into
unicode-org:main
from
kateinoigakukun:yt/wasi-support-ICU-22838
+283
−20
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kateinoigakukun
force-pushed
the
yt/wasi-support-ICU-22838
branch
from
July 26, 2024 02:09
134d917
to
c079574
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
* Add config/mh-wasi and update configure script. WebAssembly/WASI does not support threads and dynamic linking, so the new mh-wasi file disables those features in ICU. * Teach putilimp.h not to define U_TZSET, U_TIMEZONE, and U_TZNAME for WASI WASI does not define timezone-related functionalities, and wasi-libc does not provide tzset, timezone, and tzname. This change teaches putilimp.h not to define U_TZSET, U_TIMEZONE, and U_TZNAME for WASI. * Add `U_HAVE_ATOMICS` and support platforms without atomics like WASI This change adds a new macro `U_HAVE_ATOMICS` to ICU. This macro is always defined to 1 except for platforms that do not support atomic operations like WASI. Due to the lack of threading support in WASI, the wasi-sdk does not provide `std::atomic`, `std::mutex`, and related types, so the new macro is used to disable the use of these types.
kateinoigakukun
force-pushed
the
yt/wasi-support-ICU-22838
branch
from
July 26, 2024 02:32
c079574
to
f398520
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
kateinoigakukun
added a commit
to kateinoigakukun/swift-foundation-icu
that referenced
this pull request
Jul 26, 2024
The original patch is still under review in the upstream ICU project, but it is needed to unblock the swift-foundation build on WebAssembly. See unicode-org/icu#3067
kateinoigakukun
added a commit
to kateinoigakukun/swift-foundation-icu
that referenced
this pull request
Aug 2, 2024
The original patch is still under review in the upstream ICU project, but it is needed to unblock the swift-foundation build on WebAssembly. See unicode-org/icu#3067
iCharlesHu
pushed a commit
to apple/swift-foundation-icu
that referenced
this pull request
Aug 6, 2024
* Cherry-pick "ICU-22838 Add WebAssembly/WASI cross-compilation support" The original patch is still under review in the upstream ICU project, but it is needed to unblock the swift-foundation build on WebAssembly. See unicode-org/icu#3067 * [Build] Update compile definitions for WASI target `U_TIMEZONE` must not be defined and dynamic loading features must be disabled for WASI target.
iCharlesHu
pushed a commit
to iCharlesHu/swift-foundation-icu
that referenced
this pull request
Aug 6, 2024
* Cherry-pick "ICU-22838 Add WebAssembly/WASI cross-compilation support" The original patch is still under review in the upstream ICU project, but it is needed to unblock the swift-foundation build on WebAssembly. See unicode-org/icu#3067 * [Build] Update compile definitions for WASI target `U_TIMEZONE` must not be defined and dynamic loading features must be disabled for WASI target.
iCharlesHu
added a commit
to apple/swift-foundation-icu
that referenced
this pull request
Aug 7, 2024
* Cherry-pick "ICU-22838 Add WebAssembly/WASI cross-compilation support" The original patch is still under review in the upstream ICU project, but it is needed to unblock the swift-foundation build on WebAssembly. See unicode-org/icu#3067 * [Build] Update compile definitions for WASI target `U_TIMEZONE` must not be defined and dynamic loading features must be disabled for WASI target. Co-authored-by: Yuta Saito <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this patch, we can cross-compile ICU4C with wasi-sdk as follows:
Patch overview
Add config/mh-wasi and update configure script.
WebAssembly/WASI does not support threads and dynamic linking, so
the new mh-wasi file disables those features in ICU.
The new config file
mh-wasi
is used when the target matches*-wasi*
,which includes
wasm32-unknown-wasi
,wasm32-unknown-wasip1
, and etc.Teach platform.h not to define U_TZSET, U_TIMEZONE, and U_TZNAME for WASI
WASI does not define timezone-related functionalities, and wasi-libc
does not provide tzset, timezone, and tzname. This change teaches
platform.h not to define U_TZSET, U_TIMEZONE, and U_TZNAME for WASI.
Add
U_HAVE_ATOMICS
and support platforms without atomics like WASIThis change adds a new macro
U_HAVE_ATOMICS
to ICU. This macro isalways defined to 1 except for platforms that do not support atomic
operations like WASI. Due to the lack of threading support in WASI, the
wasi-sdk does not provide
std::atomic
,std::mutex
, and relatedtypes, so the new macro is used to disable the use of these types.
After #3066 and this are merged, I'd like to add CI check for WASI cross-compilation
Checklist