-
Notifications
You must be signed in to change notification settings - Fork 11
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
Compilation error when using emscripten #10
Comments
It's hard to tell what the problem is from this error. It works on my simple tests, using both What kind of My testsrc/main.rs: extern crate adler32;
use std::io::Cursor;
fn main() {
let data = b"abcdefghijklmnopqrstuvwxyz";
println!("{:x}", adler32::adler32(Cursor::new(data)).unwrap());
} Cargo.toml:
In browser console, see |
I was just trying to compile this crate without any main function, but trying with the example you provided gives the same error: $ cargo web deploy --target asmjs-unknown-emscripten
Compiling adler32 v1.0.4
Referencing function in another module!
call void <badref>(i8* %22), !dbg !35
; ModuleID = 'adler32.3rv277ty-cgu.3'
void (i8*)* <badref>
; ModuleID = '
error: could not compile `adler32`.
error: build failed I don't know how to get a more verbose output, but I can at least give you the versions I am using: $ rustc --version
rustc 1.40.0 (73528e339 2019-12-16)
$ cargo --version
cargo 1.40.0 (bc8e4c8be 2019-11-22)
$ emcc --version
emcc (Emscripten gcc/clang-like replacement) 1.39.6 ((unknown revision))
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ lsb_release -a
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a |
A web search brings up some LLVM-related issues? I don't know enough about emscripten to track this down, sorry. You might have some luck trying different versions (I'm using rustc 1.39.0 and emscripten 1.38.19). |
Turns out it's a LLVM bug, and it has been already addressed here: rust-lang/rust#66308 |
Trying to compile this crate using
asmjs-unknown-emscripten
orwasm32-unknown-emscripten
as targets results in the following error:The text was updated successfully, but these errors were encountered: