Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLLVM error while cross-compiling Servo for ARM #32049
Comments
This comment has been minimized.
This comment has been minimized.
rzambre
commented
Mar 4, 2016
|
I posted this issue. I had to delete my old account. |
sanxiyn
added
the
A-LLVM
label
Mar 7, 2016
This comment has been minimized.
This comment has been minimized.
|
You can see this by compiling the image crate version 0.7. Note that it only reproduces targeting arm32 (as shown above), not aarch64 or any of our x86_64 linux/osx/windows targets. cc @eddyb, whom we chatted with about this a bit in #servo |
This comment has been minimized.
This comment has been minimized.
|
Could someone who already has this set up run |
This comment has been minimized.
This comment has been minimized.
|
The last 10k lines: |
This comment has been minimized.
This comment has been minimized.
|
Full file will be available here shortly: |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
Reduced this. (Originally .bc weighed over 5 MB.) Clone https://github.com/sanxiyn/image/tree/reduce and:
|
This comment has been minimized.
This comment has been minimized.
|
@sanxiyn Awesome work - thanks for doing this! It would have taken me a lot longer, and I probably wouldn't have gotten it down so far. |
This comment has been minimized.
This comment has been minimized.
|
Minimized further: https://gist.github.com/alexcrichton/f7b527d749f1784508b1 Not... sure what to learn from that |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton The challenge is to get clang to trip the same assert, to prove it's a LLVM bug and have it reported upstream. |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 11, 2016
|
I understand it's a cross-compilation-only bug as it definitely doesn't reproduce natively. |
This comment has been minimized.
This comment has been minimized.
|
@petevine Is there a way to check if it's a 64-bit -> 32-bit issue? That's the first thing that jumps to mind. |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 11, 2016
|
Not sure what you meant by that. One more thing, the crates used here seem to be the official armv6 ones, whereas I'm using a natively built armv7 compiler so maybe there's some mixing of |
This comment has been minimized.
This comment has been minimized.
|
@petevine I mean, cross-compiling for |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 11, 2016
|
No, if the cross-tools are not mismatched then there shouldn't be an issue. But they could be in the armv6/v7 department. |
This comment has been minimized.
This comment has been minimized.
|
@petevine That's not what I mean. This is a bug inside LLVM, which means it could be very well be some host/target type-size dissonance. |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 11, 2016
|
No one here mentioned an EDIT: |
This comment has been minimized.
This comment has been minimized.
|
This does not reproduce for
|
This comment has been minimized.
This comment has been minimized.
|
@sanxiyn What's the diff between the completely unoptimized IR of those two targets? |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 12, 2016
|
@sanxiyn @eddyb The |
This comment has been minimized.
This comment has been minimized.
|
This reproduces on |
This comment has been minimized.
This comment has been minimized.
|
@petevine The only way this was going to be an ARM-specific issue (which is it not) is either a very strange |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Mar 12, 2016
|
Thanks and sorry for the false lead. |
This comment has been minimized.
This comment has been minimized.
|
@petevine Np, just trying to speed this up, because it looks like a bad bug that could otherwise remain unfixed for a few more years (especially if it's IR a C compiler would never generate). |
This comment has been minimized.
This comment has been minimized.
|
Since @sanxiyn didn't post it, here's their diff showing the alignment difference, made after passing both inputs through rustfilt.sh (otherwise the random symbol names introduce a lot of noise). |
larsbergstrom
referenced this issue
Mar 15, 2016
Closed
Tracking issue for Rust high-pri or blocking issues for Servo & Gecko #2853
MagaTailor
referenced this issue
Mar 25, 2016
Closed
ARM compilers always hit an LLVM assertion (if enabled) during codegen. #32360
This comment has been minimized.
This comment has been minimized.
|
What's the status here? We just hit this again: http://build.servo.org/builders/arm32/builds/1329/steps/compile/logs/stdio |
aturon
added
I-nominated
T-compiler
labels
Jun 6, 2016
This comment has been minimized.
This comment has been minimized.
|
Although it's possible I misunderstood him, @eddyb suggested to me that this was an LLVM bug -- which I guess means we may need to consider trying to find a workaround? |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Jun 7, 2016
|
The workaround in the other issue(s) is to not use |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Since this is tied to alignment, finding a LlVM target for |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton's reduced test case reproduces on 2016-03-18 but not on 2016-03-20, and 2016-03-19 doesn't exist, which gives us this range. EDIT: Great, that's #32080, which probably changed the resulting IR in subtle ways. |
This comment has been minimized.
This comment has been minimized.
|
I can confirm that #33872 is what broke Servo recently. I wonder if fixing that "the right" way (i.e. with EDIT: clang behavior: https://godbolt.org/g/EphFuK vs https://godbolt.org/g/5dikH9 |
This comment has been minimized.
This comment has been minimized.
|
Always generating a |
ghost commentedMar 4, 2016
The profile_csv3 branch compiles successfully on a Mac OS X 10.10 and on a 64-bit Ubuntu 14.04. However, while cross-compiling the profile_csv3 branch for ARM (following instructions here: https://github.com/servo/servo-nightly/blob/master/.travis.yml) using the arm-linux-gnueabihf toolchain on an Ubuntu (14.04/15.10) host, I get the following error:
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:531: void {anonymous}::PromoteMem2Reg::run(): Assertion
isAllocaPromotable(AI) && "Cannot promote non-promotable alloca!"' failed. Aborted (core dumped) Build failed, waiting for other jobs to finish... Could not compileimage`.Servo branch: https://github.com/larsbergstrom/servo/tree/profile_csv3
Environment variables set:
BUILD_TARGET=arm-unknown-linux-gnueabihf
TRIPLET=arm-linux-gnueabihf
PKG_CONFIG_ALLOW_CROSS=1
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
EXPAT_NO_PKG_CONFIG=1
FREETYPE2_NO_PKG_CONFIG=1
FONTCONFIG_NO_PKG_CONFIG=1
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
PATH="$PATH:$HOME/bin"