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

LLVM ERROR: Binary operator type not yet supported for integer types larger than 64 bits #152

Closed
svenstaro opened this issue Nov 21, 2018 · 9 comments

Comments

@svenstaro
Copy link

I get this error when trying to compile my project using cargo-web 0.6.19 and 0.6.20:

LLVM ERROR: Binary operator type not yet supported for integer types larger than 64 bits

Full log attached: build.log

System information: Arch Linux gcc 8.2.1, clang 7, rust 1.32.0-nightly. It doesn't matter when I use the emscripten/binaryen versions that cargo-web wants to download or whether I use my system versions.

There's an issue in emscripten that looks like it: emscripten-core/emscripten#3789

What I do: cargo-web build --release

My Web.toml:

default-target = "wasm32-unknown-emscripten"

[target.emscripten]
link-args = ["-s", "EMTERPRETIFY=1", "-s", "EMTERPRETIFY_ASYNC=1"]

I don't even know whether this is the right place to post this but I've got to start somewhere.

@koute
Copy link
Owner

koute commented Nov 21, 2018

This looks like something somewhere in your crate graph is using the i128/u128 type.

I had this problem myself before with serde but managed to track it down and fixed it by having serde disable the support for i128 on Emscripten by default.

So we'd need to figure out which crate exactly breaks the compilation here. I see you've upgraded to rand 0.6 - perhaps that's your culprit? I'd start with reverting that and seeing if it compiles. If that won't help then reverting to a previous Cargo.lock and quickly trying to bisect the updated dependencies might be a good idea.

@svenstaro
Copy link
Author

Super fine idea, I'll have a look.

@svenstaro
Copy link
Author

Alright so it is due to rand 0.6! And rand 0.6 did some SIMD stuff but that appears to be turned off by default. Bit clueless here.

@koute
Copy link
Owner

koute commented Nov 22, 2018

Probably due to i128 support.

From their changelog:

## [0.6.0] - 2018-11-14
...
- Support for `i128` and `u128` is automatically enabled for Rust >= 1.26. This
  renders the `i128_support` feature obsolete. It still exists for backwards
  compatibility but does not have any effect. This breaks programs using Rand
  with `i128_support` on nightlies older than Rust 1.26. (#571)

So it looks like it's turned on by default.

@svenstaro
Copy link
Author

svenstaro commented Nov 22, 2018 via email

@koute
Copy link
Owner

koute commented Nov 22, 2018

Can you experimentally just comment out the body of main in rand's build.rs, and recompile your project with that as a dependency? (Please note that there are three build.rses there in total.)

That should help confirm if that's indeed the issue, and if it is this needs to be properly fixed in rand by disabling i128 support by default on Emscripten targets.

@svenstaro
Copy link
Author

svenstaro commented Dec 24, 2018

Sorry for the long silence. Your suggestion makes it work! In particular, the problem is this line in the primary build.rs: ac.emit_rustc_version(1, 26);.

@svenstaro
Copy link
Author

Any idea where to go from here? I reported an issue upstream.

@svenstaro
Copy link
Author

Not a cargo-web problem at all and we're fixing this over in rand for now. Perhaps at some point upstream will fix this in emscripten. For the time being, the fix in rand is good enough. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants