Skip to content

cargo subcommands are much larger than necessary due to static linking #96

@huonw

Description

@huonw

The following are the sizes of the target directory after a plain make where

  • dy is crate_type = "dylib" in the cargo lib
  • static is crate_type = "rlib"
  • opt is compiling everything with -O
  • no-opt is no -O at all
  • lto is -Z lto for the binaries.
$ du *-target
6240    dy-no-opt
4236    dy-opt
29184   static-no-opt
23112   static-opt
20368   static-opt-lto

Of course, the space benefits of dynamic linking may out weighed by the ease of deployment (etc.) with static linking, but this difference will likely only get worse as there are more subcommands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions