rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.03k stars 12.68k forks source link

Compiling rustc 1.43.0 with local LLVM 10 fails #71573

Closed dilyanpalauzov closed 4 years ago

dilyanpalauzov commented 4 years ago

I call

./configure --enable-parallel-compiler --enable-optimize --llvm-root=/usr/local --enable-extended --enable-llvm-link-shared --enable-local-rust
/src/rustc-1.43.0-src/x.py  build 

and the system says:

DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,mmx,sse,sse2")
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I/usr/local/i
nclude" "-std=c++14" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_
MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DL
LVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_CO
MPONENT_LTO" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_RISCV" "-DLLV
M_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "/src/rustc-1.43.0-src/build/b
uild/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-8495e898c83de088/out/../rustllvm/PassWrapper.o" "-c" 
"../rustllvm/PassWrapper.cpp"
cargo:warning=../rustllvm/PassWrapper.cpp: In function ‘void LLVMTimeTraceProfilerInitialize()’:
cargo:warning=../rustllvm/PassWrapper.cpp:71:31: error: too few arguments to function ‘void llvm::timeTraceProfilerInitialize(unsigned int, llvm::
StringRef)’
cargo:warning=   71 |   timeTraceProfilerInitialize();
cargo:warning=      |                               ^
cargo:warning=In file included from ../rustllvm/PassWrapper.cpp:34:
cargo:warning=/usr/local/include/llvm/Support/TimeProfiler.h:22:6: note: declared here
cargo:warning=   22 | void timeTraceProfilerInitialize(unsigned TimeTraceGranularity,
cargo:warning=      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
exit code: 1

--- stderr

error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" 
"-I/usr/local/include" "-std=c++14" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "
-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_RISCV" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "/src/rustc-1.43.0-src/build/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-8495e898c83de088/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp" with args "c++" did not execute successfully (status code exit code: 1).

Indeed /usr/local/include/llvm/Support/TimeProfiler.h:timeTraceProfilerInitialize does require parameters.

jonas-schievink commented 4 years ago

LLVM 10 is not yet supported (see https://github.com/rust-lang/rust/pull/67759). It shouldn't be hard to land that change without the LLVM 10 upgrade though.

cuviper commented 4 years ago

The necessary changes landed in #70163. For 1.43, you can use the patch I applied to Fedora: https://src.fedoraproject.org/rpms/rust/blob/dd62b3568394ee83ca9b47089b30489e46af6cf2/f/rust-pr70163-prepare-for-llvm-10-upgrade.patch

dilyanpalauzov commented 4 years ago

I will retry with LLVM 10 on rust 1.44.