Description
There is a family of errors related to splitting that happen when building Firefox for android. I haven't managed to get a usefully reduced testcase. The gist of it is that it involves -Clinker-plugin-lto
and linking being done outside cargo, between C/C++ and rust code with the i686-linux-android or x86_64-linux-android targets. The former fails with LLVM ERROR: Do not know how to split the result of this operator!
, and the latter with LLVM ERROR: Cannot select: 0x7fa32221e808: v16i8 = X86ISD::PSHUFB 0x7fa323d69d40, 0x7fa2ca5946d8, /rustc/d9aa28767287670df6cf823b94629122e04442c0/library/core/src/../../stdarch/crates/core_arch/src/x86/ssse3.rs:80:15 (...)
, and seems to be related to the lack of target-features
in the LLVM-IR emitted by rust (that is, building my own rustc with this condition changed to true
fixes the issue).
It seems to me rustc should always emit target-features, especially when using -Clinker-plugin-lto, where the LLVM that will read the LLVM bytecode doesn't necessarily have the same target definitions that rustc has.
This is how this can be reproduced:
hg clone https://hg.mozilla.org/mozilla-unified
orgit clone https://github.com/mozilla/gecko-dev
cd mozilla-unified
orcd gecko-dev
mkdir ~/.mozbuild
./mach --no-interactive bootstrap --application-choice mobile_android
(this might fail to install openjdk-8-jdk-headless depending on your distro, you might need to find and install it yourself, and try again)- Restart your shell and return in the
mozilla-unified
orgecko-dev
directory. - Edit
mozconfig
to uncommentac_add_options --target=i686
and addac_add_options MOZ_LTO=cross
- Run
rustup target add i686-linux-android
./mach build