Skip to content

WASM Support#122

Closed
iwillspeak wants to merge 2 commits intorust-onig:mainfrom
artichoke:wasm3
Closed

WASM Support#122
iwillspeak wants to merge 2 commits intorust-onig:mainfrom
artichoke:wasm3

Conversation

@iwillspeak
Copy link
Copy Markdown
Collaborator

Re-open #115 to track WASM support

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.
- Set `-fvisibility=default` for bindgen runs on wasm targets.
@iwillspeak iwillspeak self-assigned this Oct 2, 2019
@iwillspeak iwillspeak changed the base branch from master to main June 13, 2020 08:10
@lopopolo
Copy link
Copy Markdown
Contributor

lopopolo commented Sep 7, 2020

@iwillspeak this is my current diff. I've been running this branch without issue for a while.

Sorry to ghost before.

main...artichoke:artichoke-vendor

@iwillspeak
Copy link
Copy Markdown
Collaborator Author

Nice. I’ll try and Make some time today to review this. Looks good from a first glance though. Thanks.

@iwillspeak iwillspeak mentioned this pull request Sep 8, 2020
@iwillspeak
Copy link
Copy Markdown
Collaborator Author

Superseded by #147.

@iwillspeak iwillspeak closed this Sep 8, 2020
@lopopolo lopopolo deleted the wasm3 branch November 21, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants