Repository: rust
Issue: 1.17.0 powerpc64le: "LLVM ERROR: Undefined temporary symbol" after disabling optimisation
Labels: A-LLVM,T-compiler,O-PowerPC,C-bug

Build log: https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=ppc64el&ver=1.17.0%2Bdfsg2-1&stamp=1495038619&raw=0 - but it also happens when I try to cross-compile from amd64 to ppc64el.

~~~~
   Compiling rustc v0.0.0 (file:///<<BUILDDIR>>/rustc-1.17.0+dfsg2/src/librustc)
     Running `/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/bootstrap/debug/rustc --crate-name rustc src/librustc/lib.rs --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C debug-assertions=off -C metadata=2dbabbd65e8c1fb6 -C extra-filename=-2dbabbd65e8c1fb6 --out-dir '/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps' --target powerpc64le-unknown-linux-gnu -L 'dependency=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps' -L 'dependency=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/debug/deps' --extern 'fmt_macros=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libfmt_macros-0ae3a1110c5d6a59.so' --extern 'graphviz=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libgraphviz-69f251278e17c653.so' --extern 'log=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/liblog-2d7ede29ab054d41.so' --extern 'log=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/liblog-2d7ede29ab054d41.rlib' --extern 'syntax=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libsyntax-ee039db76fa2c9bd.so' --extern 'rustc_back=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_back-d3da270de1cf5da2.so' --extern 'rustc_data_structures=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_data_structures-e81620800e45ed83.so' --extern 'syntax_pos=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libsyntax_pos-64299e60f35ddd83.so' --extern 'rustc_errors=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_errors-6033144335693d9c.so' --extern 'arena=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libarena-b26c5a582e48af8e.so' --extern 'serialize=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libserialize-2a05f301b8174a1d.so' --extern 'serialize=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libserialize-2a05f301b8174a1d.rlib' --extern 'rustc_llvm=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_llvm-ad254c719b9de2ea.so' --extern 'rustc_const_math=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_const_math-3ce64b122f5b797c.so' --extern 'rustc_bitflags=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_bitflags-af221885a3a0a71c.rlib' -C link-args=-Wl,-z,relro -L 'native=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/build/rustc_llvm-345e2146446b30f9/out' -L native=/usr/lib/llvm-3.9/lib`
LLVM ERROR: Undefined temporary symbol
error: Could not compile `rustc`.

Caused by:
  process didn't exit successfully: `/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/bootstrap/debug/rustc --crate-name rustc src/librustc/lib.rs --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C debug-assertions=off -C metadata=2dbabbd65e8c1fb6 -C extra-filename=-2dbabbd65e8c1fb6 --out-dir /<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps --target powerpc64le-unknown-linux-gnu -L dependency=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps -L dependency=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/debug/deps --extern fmt_macros=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libfmt_macros-0ae3a1110c5d6a59.so --extern graphviz=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libgraphviz-69f251278e17c653.so --extern log=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/liblog-2d7ede29ab054d41.so --extern log=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/liblog-2d7ede29ab054d41.rlib --extern syntax=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libsyntax-ee039db76fa2c9bd.so --extern rustc_back=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_back-d3da270de1cf5da2.so --extern rustc_data_structures=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_data_structures-e81620800e45ed83.so --extern syntax_pos=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libsyntax_pos-64299e60f35ddd83.so --extern rustc_errors=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_errors-6033144335693d9c.so --extern arena=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libarena-b26c5a582e48af8e.so --extern serialize=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libserialize-2a05f301b8174a1d.so --extern serialize=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/libserialize-2a05f301b8174a1d.rlib --extern rustc_llvm=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_llvm-ad254c719b9de2ea.so --extern rustc_const_math=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_const_math-3ce64b122f5b797c.so --extern rustc_bitflags=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/deps/librustc_bitflags-af221885a3a0a71c.rlib -C link-args=-Wl,-z,relro -L native=/<<BUILDDIR>>/rustc-1.17.0+dfsg2/build/powerpc64le-unknown-linux-gnu/stage0-rustc/powerpc64le-unknown-linux-gnu/debug/build/rustc_llvm-345e2146446b30f9/out -L native=/usr/lib/llvm-3.9/lib` (exit code: 1)


command did not execute successfully: "/usr/bin/cargo" "build" "-j" "4" "--target" "powerpc64le-unknown-linux-gnu" "-v" "--frozen" "--features" " jemalloc" "--manifest-path" "/<<BUILDDIR>>/rustc-1.17.0+dfsg2/src/rustc/Cargo.toml"
expected success, got: exit code: 101


Build completed unsuccessfully in 0:53:22
~~~~

The differences between Debian and Rust LLVM are [here](https://gist.github.com/infinity0/873566481db105fea47630da88e1b632) but I couldn't see anything relevant to powerpc64le.