-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Building rust-openssl to wasm32 on MacOS fails #1613
Comments
@alex-coinfund I'm surprised it compiled fine on Linux! A bunch of discussion about getting OpenSSL working on WASM is happening in #1016, I suspect they'd appreciate a description of how you got it working on Linux. |
This was a while back, I don’t remember off-hand. Maybe @shakhvit remembers? |
For some reason it doesn't build on Linux or Darwin at all for me, regardless of which with llvm and native vs. packaged libraries and tools I configure. Did you add any other specific changes to make it wasm compatible? |
@johnkeates I've created a repository with an example configuration. Please take a look at the build instructions in README.md and if you have any questions please feel free to contact me. But I am not using anything specific. Just as I said Here is the link to the repo: |
@shakhvit Thanks! I'll try it out in a clean environment. I just noticed that there is a slight difference in our targets as I'm using Update: this totally works for emscripten, so that's a nice improvement, it means that technically the wasm32 or a wasi SDK could do the same if there was an environment injector available. I did spot someone talking about this yesterday but I can't find the comment right now. It looks like WASI support in generally is getting plenty of traction so this would likely just be a matter of time to get a more easy-to-find implementation. |
Turns out that wasi as a target now works so this also works 😎 |
Given everything above I'm going to claim this works now, feel free to reopen if that's not true. |
Reposting from rust-lang/rust#95057 just in case anyone in the openssl community encountered something similar.
I am working on project that uses openssl and compiles to wasm (wasm32-unknown-emscripten toolchain). It builds on Linux just fine, but when I try building it on my MacOS Big Sur, I get the following error (removing some irrelevant information from the output):
Obviously, it is incorrectly using Apple's native libraries and tools where it should be using those provided by emscripten. My workaround was to link emscripten's llvm-ar as ar (same for ranlib) and put them temporarily on the front of my $PATH, which works. Yet, I still wanted to report, or see if I'm missing something obvious wrt building wasm on MacOS.
The text was updated successfully, but these errors were encountered: