Testing built-from-source Rust 1.38.0 fails because of 3 tests

I'm building Rust 1.38.0 from source. LLVM target is X86, triples are "amd64-unknown-linux-gnu" and "i686-unknown-linux-gnu". I'm also building cargo with ./x.py install cargo as stated on Github.

Rust builds and installs file, but testing (./x.py test) fails on three tests:

  • [ui] ui/issues/issue-37131.rs
  • [ui] ui/issues/issue-49851/compiler-builtins-error.rs
  • [ui] ui/issues/issue-50993.rs

The errors are all related to missing ARM targets, here's one of them:

error[E0463]: can't find crate for `std`
-          |
-          = note: the `thumbv6m-none-eabi` target may not be installed
+       error: Could not create LLVM TargetMachine for triple: thumbv6m-none-eabi: No available targets are compatible with triple "thumbv6m-none-unknown-eabi"

The other errors are identical, excect for the triple that is thumbv7em-none-eabihf. To me it's pretty obvious that ARM targets are missing, since I'm building for x86. Can you help me?

Please share how you are configuring the build. config.toml in particular.

cargo = "/usr/bin/cargo"
docs = false
rustc = "/usr/bin/rustc"
# This is in addition to host's triple: x86_64-unknown-linux-gnu in our case
target = ["i686-unknown-linux-gnu"]
vendor = true

libdir = "/usr/lib64"
prefix = "/usr"

ninja = true
targets = "X86"

channel = "stable"
rpath = false

ar = "/usr/bin/ar"

ar = "/usr/bin/ar"

CFLAGS and CXXFLAGS: -march=x86-64 -mtune=generic -O3 -fstack-protector -pipe"

Those tests are expected to fail when you set llvm.targets to X86. Delete targets = "X86" line and they should pass.

Wouldn't that result in a bigger llvm? I'm building Rust for a distro that only supports x86 machines, we don't need other archs. Keeping packages in the repo small is also a big plus.

It is not about which architectures Rust run on. Rust is expected to be able to cross compile, so cross compilation is tested by the test suite. Rust built with targets = "X86" can't cross compile, so it naturally fails those tests.

Crystal clear. Thanks for your help.