Skip to content

Duplication of libLLVM-*.so in the distributed rustc component. #70838

Closed
@eddyb

Description

@eddyb

Since #57286, libLLVM-*.so has been distributed in the rustc component in two locations:

  • lib/libLLVM-*.so (presumably as a runtime dependency of bin/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

The difference can be seen in these consecutive nightlies' rustc components:

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:

// Ensure that `libLLVM.so` ends up in the newly build compiler directory,
// so that it can be found when the newly built `rustc` is run.
dist::maybe_install_llvm_dylib(builder, target_compiler.host, &sysroot);

cc @alexcrichton @rust-lang/release

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-heavyIssue: Problems and improvements with respect to binary size of generated code.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions