[lfs-dev] rustc in BLFS-10.0 : stick with 1.42.0 :-(

Ken Moffat zarniwhoop at ntlworld.com
Fri Jul 31 20:05:42 PDT 2020


People may have noticed that I was hoping to propose that we update
rustc to 1.45.0 for our 10.0 release.  I've now dropped that hope.

For 1.45.0 my thinking was:

i) it's current.

ii) it might stop us having to upgrade for a while (from current
packages, librsvg will be what probaby forces that).

iii) it fixed a longstanding rust issue which could cause undefined
behaviour: https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html
(not bad for a compiler which claims to be safe except when using
items labelled as unsafe).

I also noted that thunderbird-78.0.1 failed to build for me using
gcc (an error from rust that a combination of clang flags were
incompatible) - people using clang had already hit that, and gentoo
had a sed for (I think) firefox.

So, on my current experimental build (same packages and
optimizations as last weekend except for kernel headers,
binutils-2.35, gcc-10.2.0, llvm-11.0.0RC1) I was expecting to look
at this.

But neither our current rustc-1.42.0, nor rustc-1.45.0, can be built
with that llvm rc.  The error from 1.42.0 started like this (and
1.45.0 looked similar):

running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-march=native" "-fstack-clash-protection" "-D_FORTIFY_SOURCE=2" "-fstack-protector-strong" "-I/usr/include" "-std=c++14" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "/scratch/working/rustc-1.42.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-b716d70709b7ebd7/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
cargo:warning=In file included from /usr/include/llvm/IR/Use.h:29,
cargo:warning=                 from /usr/include/llvm/IR/User.h:23,
cargo:warning=                 from /usr/include/llvm/IR/Constant.h:16,
cargo:warning=                 from /usr/include/llvm/IR/Metadata.h:29,
cargo:warning=                 from /usr/include/llvm/IR/TrackingMDRef.h:16,
cargo:warning=                 from /usr/include/llvm/IR/DebugLoc.h:17,
cargo:warning=                 from /usr/include/llvm/IR/Instruction.h:22,
cargo:warning=                 from /usr/include/llvm/IR/BasicBlock.h:22,
cargo:warning=                 from /usr/include/llvm/IR/IRBuilder.h:22,
cargo:warning=                 from ../rustllvm/rustllvm.h:9,
cargo:warning=                 from ../rustllvm/PassWrapper.cpp:6:
cargo:warning=../rustllvm/PassWrapper.cpp: In function 'T* unwrap(LLVMPassManagerBuilderRef)':
cargo:warning=../rustllvm/PassWrapper.cpp:43:1: error: call of overloaded 'unwrap(LLVMOpaquePassManagerBuilder*&)' is ambiguous

>From that I conclude that current versions of rustc with llvm-11
will need their shipped llvm, which is slow and large to build (on
this system, 1.42.0 with its shipped llvm took 40.8 SBU and
installed 394.3 MiB on this 8-thread machine, against 34.3 SBU and
250.8 MiB for a build from the beginning of June - both without
running the tests).

Meanwhile, rustc-1.45.1 is out, but the release notes
https://blog.rust-lang.org/2020/07/30/Rust-1.45.1.html do not
mention llvm-11.  The 1.46.0 release is expected to be after 15th
April and llvm-11 probably won't be released until September.  So I
doubt that anyone will fix rustc for building with sysllvm in the
near future.

Therefore, for our 10.0 release rustc-1.42.0 looks like the way to
go.

ĸen
-- 
+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
                          - Hogfather


More information about the lfs-dev mailing list