Skip to content

Debug build of libLLVM.so is enormous #67109

Closed as not planned
Closed as not planned
@Aaron1011

Description

@Aaron1011

This isn't an issue with Rust per se - however, it has implications for people building the compiler.

The libLLVM.so shipped with the Rust compiler (libLLVM-9-rust-1.41.0-nightly.so at the time of writing) is currently 80MB. While this seems incredibly large for a shared library, it's still only slightly larger than librustc_driver (63MB).

This is unfortunate, but things become much worse when llvm.release-debuginfo=true is set in config.toml. This makes libLLVM-9-rust-1.41.0-dev-de1a7dbf6.so take up 2.1 GB of space.

To make matters worse, we currently copy libLLVM.so to a target directory when building the compiler:

builder.install(&llvm_dylib_path, &dst_libdir, 0o644);

With #67077, we may have to copy it into even more places. This represents a non-trivial amount of disk space.

I don't think there's much we can directly do about the size of libLLVM.so, other than making sure upstream is aware of this. However, we might want to consider symlinking libLLVM.so, rather than copying it. I know this works for shared libraries on Linux, but I'm not sure about other platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-heavyIssue: Problems and improvements with respect to binary size of generated code.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions