Building libstd etc... from source


Hello everyone!

Since a couple of days, I have the following workflow, to update my rust stuff to more recent versions. I go trough that nearly daily.

The workflow:

  1. Update local rust installation with
  2. Check, if my projects are building. If not:
  • Fix dependencies (cargo update)
  • Fix own code (incompatibilities from one rust version to the next)
  1. Build with --release

Now the steps, which I want to optimize, because it takes simply to long:

  1. Checkout compiler source code on same version / hash, that rustc --version delivers
  2. Build the compiler with arm-unknown-linux-gnueabihf as an extra target.
  3. Copy the libraries (libstd, libcollections…) from the newly built compiler into my /usr/local/lib/rustlib/arm-unknown-linux-gnueabihf directory, to be able to build my projects for arm too.
  4. Compile my projects with --release and --target=arm-unknown-linux-gnueabihf

Everything works just fine, but it seems like building an entire rust toolchain with compiler etc…, with all three stages is a bit silly, if I only need the libraries(libstd, …), for my arm target.

How can I achieve, to build for my arm target with standard libraries, without recompiling the whole compiler?

Edit: On my machine bootstrapping a new rust toolchain can take 4 to six hours :frowning:


you could only run “make stage1”, which will at least prevent the second compilation.

Why don’t you need the compiler? You need something to compile your own projects.


I already have the compiler thanks to, which downloads and installs a compiler, which can compile to any platform, but is missing the libraries for all platforms except the host one.

Building stage1 also builds the compiler, and takes also a long time. Of course it is a little bit better than make all.