Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8931 closed enhancement (fixed)

Install llvm-3.9.1 in /opt for rust.

Reported by: ken@… Owned by: ken@…
Priority: normal Milestone: 8.1
Component: BOOK Version: SVN
Severity: normal Keywords:


For the moment, we do not build rust. But it is expected that firefox-53 (due early April) will require it.

To use the system version of llvm, rust's configure script now looks for FileCheck (a test program to compare two versions of a file). Since LLVM-3.8 this is no longer installed by default, it requires


Noted at and

For the moment I have got no further than discovering this requirement, no idea if extra changes (e.g. needing clang) will be needed.

Change History (15)

comment:1 by ken@…, 5 years ago

Owner: changed from blfs-book@… to ken@…
Status: newassigned

comment:2 by ken@…, 5 years ago


comment:3 by Douglas R. Reno, 5 years ago

I'm going to have to build LLVM later on today/tonight. Do you want me to try building it with this option?

comment:4 by ken@…, 5 years ago

I've already done a local build like that - it helped (building rustc was much less slow and less big), the only apparent difference in LLVM was a few extra utility programs.

OTOH you might have aeady gone past this by now.

comment:5 by Douglas R. Reno, 5 years ago

I made a typo in my script and had to restart the build of LLVM. I've added this option to the list, because if we'll need it in the future, I'd rather have it *now* then have to rebuild this large package later.

comment:6 by Douglas R. Reno, 5 years ago

I made *yet* another typo by somehow building 3.8.1. I should stop building things around 2:00AM. :-)

comment:7 by ken@…, 5 years ago

See #8951 for my provisional comparisons of build sizes and times using system/shipped LLVM-3.9. Ideally, a static build against system LLVM would be quickest and smallest.

But we have already moved to LLVM-4. Unless rustc gets updated for that by the time we need to build it for firefox, this will be "overtaken by events".

comment:8 by ken@…, 5 years ago

Various comments in mozilla bug reports suggest that, at least for the next few firefox releases, the latest version of rust will be needed (the language is still developing, they will want the additions) and therefore rust will probably need to be upgraded for each new firefox major version.

I've experimentally installed a cut-down llvm-3.9.1 (only the basic part, only for host cpu, but with FileCheck) in /opt/llvm3 on my underpowered test machine (the AMD Kaveri) so that I can decide if that is likely to be worthwhile on a non-high-end machine.

Unfortunately, my scripted build of rust, with the system llvm-3 and the tests, took over 47 minutes. When I looked at top while rust was building, it only ever seemed to use 100% or 200% CPU instead of 400%. I need to do more testing/measuring on that machine once the build is completed.

comment:9 by ken@…, 5 years ago

Summary: LLVM install instructions insufficient to build rust.Install llvm-3.9.1 in /opt for rust.

Building 3.9.1 for /opt (minimally - for HOST only, with the utils) and then using that for rust takes about the same time as building rust with its shipped llvm on a 4-core machine.

The second build of rust will therefore show a time saving.

And the only way to upgrade rust from source is to build it afresh - the rustup program is only for updating the binary versions.

More comments on the random nature of the rust testsuite will probably appear in the rust ticket soon.

comment:10 by ken@…, 5 years ago

One further comment - until now I've been building shared and static llvm, but actually using static llvm for rust. So I first tried slimming the build down to only static - that works, but it offends me (although not much more than rust's shipped static llvm).

So then I tried enabling dynamic llvm and hiding the static libs. That built ok, but the (DESTDIR) install failed to link -lLLVM-3.9 which is a shared lib in /opt/llvm3/lib, and that is in /etc/ That is for error_index_generator. I added LDFLAGS=-L/opt/llvm3/lib and got past that, but then the same error in rustbook. I remembered that fedora had previously commented that it uses gcc for the linker, so I tried adding that to CFLAGS as well : now it failed again at error_index_generator.

I also note that Arch no longer enable llvm-link-shared. So, static it is.

comment:11 by ken@…, 5 years ago

Went to bed, thought of a workaround: symlink from /usr/lib. Works.

But I've changed so much in this that I start to lack confidence whether it still hangs together - need to find a recent-enough system where I have not yet installed rust - I think that probably needs a fresh build to ensure it has lvm-4.0.0.

comment:12 by ken@…, 5 years ago

Done in r18591.

comment:13 by ken@…, 5 years ago

Resolution: fixed
Status: assignedclosed

comment:14 by bdubbs@…, 5 years ago

Milestone: 8.1m8.1

Milestone renamed

comment:15 by bdubbs@…, 5 years ago

Milestone: m8.18.1

Milestone renamed

Note: See TracTickets for help on using tickets.