tried rebuilding rust with llvm:8 and caught this. --- stderr thread 'main' panicked at ' Internal error occurred: Command "x86_64-pc-linux-gnu-g++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-m64" "-I/usr/lib/llvm/8/include" "-std=c++11" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_X86" "-o" "/tmp/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-5141c6241c4969af/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp" with args "x86_64-pc-linux-gnu-g++" did not execute successfully (status code exit code: 1). ', /tmp/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/vendor/cc/src/lib.rs:2314:5 note: Run with `RUST_BACKTRACE=1` for a backtrace. command did not execute successfully: "/tmp/portage/dev-lang/rust-1.33.0/work/rust-stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "8" "--release" "--locked" "--frozen" "--manifest-path" "/tmp/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/librustc_codegen_llvm/Cargo.toml" "--features" "" "--message-format" "json" expected success, got: exit code: 101 Traceback (most recent call last):
cargo:rerun-if-changed=../rustllvm/llvm-rebuild-trigger TARGET = Some("x86_64-unknown-linux-gnu") OPT_LEVEL = Some("2") HOST = Some("x86_64-unknown-linux-gnu") CXX_x86_64-unknown-linux-gnu = Some("x86_64-pc-linux-gnu-g++") CXXFLAGS_x86_64-unknown-linux-gnu = Some("-ffunction-sections -fdata-sections -fPIC -m64 -m64") DEBUG = Some("false") running: "x86_64-pc-linux-gnu-g++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-m64" "-I/usr/lib/llvm/8/include" "-std=c++11" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_X86" "-o" "/tmp/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-5141c6241c4969af/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp" exit code: 0 running: "x86_64-pc-linux-gnu-g++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-m64" "-I/usr/lib/llvm/8/include" "-std=c++11" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_X86" "-o" "/tmp/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-5141c6241c4969af/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp" cargo:warning=../rustllvm/RustWrapper.cpp: In function 'LLVMOpaqueMetadata* LLVMRustDIBuilderCreateFunction(LLVMRustDIBuilderRef, LLVMMetadataRef, const char*, const char*, LLVMMetadataRef, unsigned int, LLVMMetadataRef, bool, bool, unsigned int, LLVMRustDIFlags, bool, LLVMValueRef, LLVMMetadataRef, LLVMMetadataRef)': cargo:warning=../rustllvm/RustWrapper.cpp:587:38: error: no matching function for call to 'llvm::DIBuilder::createFunction(llvm::DIScope*, const char*&, const char*&, llvm::DIFile*, unsigned int&, llvm::DISubroutineType*, bool&, bool&, unsigned int&, llvm::DINode::DIFlags, bool&, llvm::DITemplateParameterArray&, llvm::DISubprogram*)' cargo:warning= unwrapDIPtr<DISubprogram>(Decl)); cargo:warning= ^ cargo:warning=In file included from ../rustllvm/rustllvm.h:53, cargo:warning= from ../rustllvm/RustWrapper.cpp:1: cargo:warning=/usr/lib/llvm/8/include/llvm/IR/DIBuilder.h:663:5: note: candidate: 'llvm::DISubprogram* llvm::DIBuilder::createFunction(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DISubroutineType*, unsigned int, llvm::DINode::DIFlags, llvm::DISubprogram::DISPFlags, llvm::DITemplateParameterArray, llvm::DISubprogram*, llvm::DITypeArray)' cargo:warning= createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName, cargo:warning= ^~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm/8/include/llvm/IR/DIBuilder.h:663:5: note: candidate expects 12 arguments, 13 provided cargo:warning=../rustllvm/RustWrapper.cpp: In function 'void LLVMRustUnpackOptimizationDiagnostic(LLVMDiagnosticInfoRef, RustStringRef, LLVMOpaqueValue**, unsigned int*, unsigned int*, RustStringRef, RustStringRef)': cargo:warning=../rustllvm/RustWrapper.cpp:923:23: error: 'class llvm::DiagnosticLocation' has no member named 'getFilename'; did you mean 'getLine'? cargo:warning= FilenameOS << loc.getFilename(); cargo:warning= ^~~~~~~~~~~ cargo:warning= getLine exit code: 1
Created attachment 570084 [details] rust build log
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d3572f4171ba4ad6b0ecd03711b0b52d975bd6c commit 8d3572f4171ba4ad6b0ecd03711b0b52d975bd6c Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2019-03-21 22:49:31 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2019-03-22 04:27:48 +0000 dev-lang/rust: 1.33.0 requires llvm:7 to build improve llvm handling for future use, taken from mesa ebuild make sure 1.33 pulls only llvm:7 Bug: https://bugs.gentoo.org/681108 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-lang/rust/rust-1.33.0.ebuild | 41 ++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-)
Has this been reported to Rust upstream?
(In reply to Alec Ari from comment #4) > Has this been reported to Rust upstream? yes, see URL field of the bug.
To be honest, I would p.u.mask USE=system-llvm after my experience with rust: Upstream doesn't really support that and is maintaining an own LLVM fork which has patches (and even requires patches!) not yet landed in LLVM upstream... People who know what they are doing can lift the mask. But normal user don't know that and because system-* USE flags are good in general they are surprised when they learn about problems caused by mixing recent rust with outdated LLVM nobody except some other Gentoo user use.
Rust 1.33 has the same issue as Rust 1.32, nice.. Thomas, I fully agree with your statement and would like to add that the Rust developers be smacked upside the head for the trouble they've caused. It's not a good default requirement to have two versions of LLVM installed, one for rust and the other for absolutely everything else.
p.u.masking USE=system-llvm sounds about right. I was always skeptical that this was going to work well, but some people in IRC were very persistent about it. The thing is that it might work okay in most releases when the LLVM release has been out for a while, but in reality it feels like upstream adopts newer LLVM much faster than we can, without having CI in place to check that their commitment to support one older LLVM release is actually valid.
not sure if anything can be done here. 1.34 is out and builds with llvm:8 and I've limited it to pull 8 only despite upstream claiming minimum version is 6. 1.34 works fine with system-llvm for now, if next version breaks again the best way will be masking system-llvm for time being.
Are you feeding back bugs to upstream to get compilation against LLVM 7.0.1 fixed, at least? Would be useful to hold them to their contract, IMO.