Support building onig on wasm32-unknown-unknown target#115
Closed
lopopolo wants to merge 3 commits intorust-onig:masterfrom
Closed
Support building onig on wasm32-unknown-unknown target#115lopopolo wants to merge 3 commits intorust-onig:masterfrom
lopopolo wants to merge 3 commits intorust-onig:masterfrom
Conversation
Setting this define enables oniguruma to build for wasm32-unknown-unknown target under clang-8.
- Unwrap env variables only when required. - Handle cases where `CARGO_CFG_TARGET_FAMILY` is not set. There is no need to unwrap this env var since we are only using it to optionally set some compiler flags. - For wasm builds, define `ONIG_DISABLE_DIRECT_THREADING`. This is a new macro in oniguruma which disables computed gotos, which are unsupported by clang-8 when compiling to wasm targets. - Override `ONIG_EXTERN` to set function visibility for wasm builds. By default, functions are not exported under wasm targets. This flag ensures all functions in the static onig library are marked exported.
Building a cdylib enables generating a wasm bundle for wasm targets
Contributor
Author
|
This is the followup to GH-106. |
This was referenced Aug 17, 2019
Contributor
Author
|
The only failing build is Rust 1.32.0 This PR uses an if let pattern in |
Contributor
Author
|
Oh, the minimum supported Rust version varies by OS. I find that confusing. |
This was referenced Aug 20, 2019
Closed
Contributor
Author
|
I'll maintain this branch on my fork. If you are interested in merging this, please reopen this issue. |
Collaborator
|
Sorry for ignoring this PR. I've been busy for quite some time with other life things. I'll re-open this and merge it after other refactorings of |
Closed
Collaborator
|
I've had to create a new PR for this. Apparently you can't re-open a PR if it is force-pushed when closed. :-/ |
This file contains hidden or 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
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.
This PR adds support for the wasm32-unknown-unknown target to onig and onig_sys crates.
This currently does not produce a useful artifact due to rust-lang/rust#63629, but it builds successfully when supplying C stdlib headers that support the target. For example, using the emscipten headers and clang-9:
To achieve this goal, this PR pulls in a new version of oniguruma that has this PR kkos/oniguruma#150 which introduces a macro to disable computed gotos which clang-8 cannot compile for wasm32-unknown-unknown.
This PR also refactors
build.rsto be more robust to "non-exotic targets".