Description
Since #57286, libLLVM-*.so
has been distributed in the rustc
component in two locations:
lib/libLLVM-*.so
(presumably as a runtime dependency ofbin/rustc
)lib/rustlib/$target/lib/libLLVM-*.so
(not sure, maybe for linking custom drivers?)- likely belongs in the
rustc-dev
component, if the duplication can't be avoided
- likely belongs in the
The difference can be seen in these consecutive nightlies' rustc
components:
- https://static.rust-lang.org/dist/2019-01-06/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
- has just the second
libLLVM-*.so
- maybe it's used via relative
RPATH
bylib/rustlib/$target/codegen-backends/librustc_codegen_llvm-llvm.so
? separate codegen backends are gone, maybe we should just try removing it?
- maybe it's used via relative
- has just the second
- https://static.rust-lang.org/dist/2019-01-07/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
- first nightly to include bootstrap: Link LLVM as a dylib with ThinLTO (take 2) #57286
- has both copies
All 3 of those libLLVM-8svn.so
files are identical (even across nightlies, yay for deterministic builds):
e400d157a7ceaee26f8680cb6f7430bd98c251dbb32e1f10549dda9f5769dc42 before/rustc-nightly-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-8svn.so
e400d157a7ceaee26f8680cb6f7430bd98c251dbb32e1f10549dda9f5769dc42 after/rustc-nightly-x86_64-unknown-linux-gnu/rustc/lib/libLLVM-8svn.so
e400d157a7ceaee26f8680cb6f7430bd98c251dbb32e1f10549dda9f5769dc42 after/rustc-nightly-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-8svn.so
One fascinating aspect is that the size only increases from 82.22 MiB
to 83.18 MiB
, despite libLLVM-8svn.so
alone being 67 MiB
uncompressed, so compression is really helping.
Even the .tar.gz
only goes from 111.41 MiB
to 113.26 MiB
.
(I'm using archive sizes from the 2019-01-06 and 2019-01-07 directory listings in https://static.rust-lang.org/dist, FWIW)
This part of the build system seems relevant, but I'm not sure which of the two this creates:
Lines 755 to 757 in 733f104
cc @alexcrichton @rust-lang/release