Skip to content

Statically link against glibc #65447

Closed
@NilsIrl

Description

@NilsIrl

Reasons for:

  1. Performance. According to this reddit message, musl caused a program to run 9x slower. Musl is also known to be slower in certain configurations in C. This varies a lot with the use case and some might even see a performance increase with musl.
  2. Smaller docker containers using FROM scratch. example using musl

It is possible to link glibc statically as demonstrated here.

From what I can tell, on the user facing side, this would be enable using -C target-feature=+crt-static as described in the reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, 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