Skip to content
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

Compile Error wasm32-unknown-emscripten #1662

Closed
Z1W3 opened this issue Jul 11, 2022 · 3 comments
Closed

Compile Error wasm32-unknown-emscripten #1662

Z1W3 opened this issue Jul 11, 2022 · 3 comments
Labels

Comments

@Z1W3
Copy link

Z1W3 commented Jul 11, 2022

how can i solve this ???

my example code : https://github.com/Z1W3/hello-wasm

....... more
  install ./include/openssl/x509v3.h -> /Users/catt.zhi/Projects/AndroidStudioProjects/payease/fork_projects/ehking-common-android/hello-wasm2/target/wasm32-unknown-emscripten/debug/build/openssl-sys-b67cdc9bfaf9e556/out/openssl-build/install/include/openssl/x509v3.h
  install ./include/openssl/x509v3err.h -> /Users/catt.zhi/Projects/AndroidStudioProjects/payease/fork_projects/ehking-common-android/hello-wasm2/target/wasm32-unknown-emscripten/debug/build/openssl-sys-b67cdc9bfaf9e556/out/openssl-build/install/include/openssl/x509v3err.h
  install libcrypto.a -> /Users/catt.zhi/Projects/AndroidStudioProjects/payease/fork_projects/ehking-common-android/hello-wasm2/target/wasm32-unknown-emscripten/debug/build/openssl-sys-b67cdc9bfaf9e556/out/openssl-build/install/lib/libcrypto.a

  --- stderr
  ar: creating archive apps/libapps.a
  warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: apps/libapps.a the table of contents is empty (no object file members in the library define global symbols)
  ar: creating archive libcrypto.a
  warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: libcrypto.a the table of contents is empty (no object file members in the library define global symbols)
  ar: creating archive libssl.a
  warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: libssl.a the table of contents is empty (no object file members in the library define global symbols)
  LLVM ERROR: malformed uleb128, extends past end
  /bin/sh: line 1: 23405 Abort trap: 6           ranlib "/Users/catt.zhi/Projects/AndroidStudioProjects/payease/fork_projects/ehking-common-android/hello-wasm2/target/wasm32-unknown-emscripten/debug/build/openssl-sys-b67cdc9bfaf9e556/out/openssl-build/install/lib/$fn.new"
  make: *** [install_dev] Error 134
  thread 'main' panicked at '


  Error installing OpenSSL:
      Command: "make" "install_dev"
      Exit status: exit status: 2


      ', /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-src-111.22.0+1.1.1q/src/lib.rs:490:13
  stack backtrace:
     0:        0x10c7051b4 - std::backtrace_rs::backtrace::libunwind::trace::hee82a97921985ffc
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
     1:        0x10c7051b4 - std::backtrace_rs::backtrace::trace_unsynchronized::hd2f3f197f68d4196
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:        0x10c7051b4 - std::sys_common::backtrace::_print_fmt::hef7f7070435a43cf
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:66:5
     3:        0x10c7051b4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6ab6a4b798848da1
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:45:22
     4:        0x10c71faab - core::fmt::write::h3cfeb2e4a41b5943
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/fmt/mod.rs:1196:17
     5:        0x10c701a88 - std::io::Write::write_fmt::h207c490a0e714424
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/io/mod.rs:1654:15
     6:        0x10c70744d - std::sys_common::backtrace::_print::h2c39637d8acc9668
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:48:5
     7:        0x10c70744d - std::sys_common::backtrace::print::ha24f17eeb0536253
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:35:9
     8:        0x10c70744d - std::panicking::default_hook::{{closure}}::h2dad0ca14a5f6fb3
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:295:22
     9:        0x10c707131 - std::panicking::default_hook::he28ca1b524a71648
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:314:9
    10:        0x10c7079ce - std::panicking::rust_panic_with_hook::hc50fd680dab3e13f
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:698:17
    11:        0x10c7078c3 - std::panicking::begin_panic_handler::{{closure}}::h73da24fc37eba97b
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:588:13
    12:        0x10c705637 - std::sys_common::backtrace::__rust_end_short_backtrace::hff104f8fa804dc90
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:138:18
    13:        0x10c70759a - rust_begin_unwind
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
    14:        0x10c729183 - core::panicking::panic_fmt::hf5e95a7953f70bca
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
    15:        0x10c66f136 - openssl_src::Build::run_command::h268145f1e5811d0c
                                 at /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-src-111.22.0+1.1.1q/src/lib.rs:490:13
    16:        0x10c66e98a - openssl_src::Build::build::h0cde65246d9ab6d8
                                 at /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-src-111.22.0+1.1.1q/src/lib.rs:466:13
    17:        0x10c636890 - build_script_main::find_vendored::get_openssl::h51badb27526fc928
                                 at /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.75/build/find_vendored.rs:5:21
    18:        0x10c630623 - build_script_main::find_openssl::h048ea80572f97a77
                                 at /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.75/build/main.rs:57:20
    19:        0x10c63072f - build_script_main::main::hab857904629abe2d
                                 at /Users/catt.zhi/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.75/build/main.rs:68:35
    20:        0x10c63617e - core::ops::function::FnOnce::call_once::h0ef58b45c9ce9379
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:248:5
    21:        0x10c637071 - std::sys_common::backtrace::__rust_begin_short_backtrace::h86efd40681ca690d
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:122:18
    22:        0x10c63c494 - std::rt::lang_start::{{closure}}::h81d0f76ee4b55581
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:145:18
    23:        0x10c6fca7e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h95efaa71c50a181d
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:280:13
    24:        0x10c6fca7e - std::panicking::try::do_call::h9e262f45d279a668
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
    25:        0x10c6fca7e - std::panicking::try::hcfa2ff7c3ef05946
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
    26:        0x10c6fca7e - std::panic::catch_unwind::h6e5f05af2d5ed125
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
    27:        0x10c6fca7e - std::rt::lang_start_internal::{{closure}}::ha6428ebd453bcc4b
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:48
    28:        0x10c6fca7e - std::panicking::try::do_call::h1897e56454854402
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
    29:        0x10c6fca7e - std::panicking::try::h18317894fcdd1ee4
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
    30:        0x10c6fca7e - std::panic::catch_unwind::h953eb8e106926f6b
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
    31:        0x10c6fca7e - std::rt::lang_start_internal::h3a2ed64a839cce39
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:20
    32:        0x10c63c46e - std::rt::lang_start::hfd8ea766d5846684
                                 at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:144:17
    33:        0x10c634156 - _main

@thy4862
Copy link

thy4862 commented Sep 16, 2022

Obviously, rust-openssl relies on the system's OpenSSL library, and the wasm compilation platform is not sure if it exists. You can find the information here. Crates like sha256 may solve your problem.

@Skepfyr
Copy link
Collaborator

Skepfyr commented Sep 21, 2022

Getting OpenSSL to compile for wasm looks like it might be possible but you're definitely going to have to play around with this yourself (probably by forking openssl-src), I haven't found all that many people doing it so you're likely treading new ground. As @thy4862 says you may find it easier to use pure Rust libraries and not try and link to OpenSSL.

@Skepfyr
Copy link
Collaborator

Skepfyr commented Jan 5, 2023

I'm closing this in favour of #1016.

@Skepfyr Skepfyr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants