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

Android build fails with LLVM error #10517

Closed
mmatyas opened this issue Apr 11, 2016 · 8 comments
Closed

Android build fails with LLVM error #10517

mmatyas opened this issue Apr 11, 2016 · 8 comments
Labels

Comments

@mmatyas
Copy link
Contributor

@mmatyas mmatyas commented Apr 11, 2016

The Android build fails with the following error:

LLVM ERROR: Constant Island pass failed to converge!
Build failed, waiting for other jobs to finish...
error: Could not compile `cssparser`.

Caused by:
  Process didn't exit successfully: `rustc /home/mmatyas/Servo/servo-x64/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/cssparser-0.5.5/src/lib.rs --crate-name cssparser --crate-type lib -C opt-level=3 -C codegen-units=4 --cfg feature="heap_size" --cfg feature="serde" --cfg feature="serde_macros" --cfg feature="serde-serialization" --cfg feature="heapsize_plugin" --cfg feature="heapsize" -C metadata=a00db9153a066bec -C extra-filename=-a00db9153a066bec --out-dir /home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps --emit=dep-info,link --target arm-linux-androideabi -C ar=arm-linux-androideabi-ar -C linker=/home/mmatyas/Servo/servo-x64/servo/components/servo/./fake-ld.sh -L dependency=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps -L dependency=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps --extern heapsize_plugin=/home/mmatyas/Servo/servo-x64/servo/target/release/deps/libheapsize_plugin-00846447151e4ac3.so --extern serde_macros=/home/mmatyas/Servo/servo-x64/servo/target/release/deps/libserde_macros-c550fbd19e352e36.so --extern encoding=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps/libencoding-8b01435d6d00d080.rlib --extern matches=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps/libmatches-030a774745cc4f96.rlib --extern heapsize=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps/libheapsize-6b0058e51ea0ec07.rlib --extern serde=/home/mmatyas/Servo/servo-x64/servo/target/arm-linux-androideabi/release/deps/libserde-3a777b14c091f0d1.rlib --cap-lints allow -C link-args=-fuse-ld=gold -C target-feature=+neon` (exit code: 1)

I've tried on multiple systems, on Ubuntu 15.10 and 14.04, using Android NDK r10d. Here's a Travis log: https://travis-ci.org/mmatyas/servo-nightly/jobs/122117906

@eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 11, 2016

Error comes from an ARM-specific pass which can have its threshold increased, presumably by setting:

RUSTFLAGS="-C llvm-args=-arm-constant-island-max-iteration=100"

However, comments indicate this is an extreme case - could you get the output of that rustc command with --emit=llvm-ir?

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Apr 11, 2016

Running RUSTFLAGS="-C llvm-args=-arm-constant-island-max-iteration=100" ./mach build -r --android results in

rustc: Unknown command line argument '-arm-constant-island-max-iteration=100'.  Try: 'rustc -help'
rustc: Did you mean '-mips-constant-islands-small-offset=100'?

and adding --emit=llvm-ir to the failing rustc command in the first post results in

cfgspec:1:9: 1:21 error: unexpected token: `serde_macros`
cfgspec:1 feature=serde_macros
                  ^~~~~~~~~~~~
@eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 11, 2016

Oh, I didn't check the LLVM branch Rust uses, which hardcodes that limit (so the option was added since the last Rust LLVM update).

@eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 11, 2016

Looks like https://llvm.org/bugs/show_bug.cgi?id=25339 which has been fixed late February and Rust needs a LLVM update to get the fix. cc @alexcrichton

@alexcrichton
Copy link
Contributor

@alexcrichton alexcrichton commented Apr 11, 2016

Ah yeah it should be fine to backport the fix to our LLVM branch (currently 2016-03-13) at the time of this writing.

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Apr 15, 2016

Just a note, the error also occurred when I tried to cross compile to ARM with RUSTFLAGS=' -C target-feature=+neon'.

@fabricedesre
Copy link
Contributor

@fabricedesre fabricedesre commented Apr 26, 2016

Is someone actively working on the LLVM backport?

@mmatyas
Copy link
Contributor Author

@mmatyas mmatyas commented Jul 1, 2016

Looks like this got fixed, so I'm closing the issue.

@mmatyas mmatyas closed this Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.