Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap libraries in linker groups, allowing backwards/circular references #85805

Closed
wants to merge 2 commits into from

Commits on Jun 23, 2021

  1. Wrap libraries in linker groups, allowing backwards/circular references

    Some native library sets, such as components of libc, libgcc, or
    compiler-builtins, require backwards or circular references.
    Additionally, because link order doesn't matter for native libraries
    when using dynamic linking, many crates don't take it into account for
    static linking either; this can introduce platform-specific issues.
    Rather than make the order of `#[link]` lines or `cargo:rustc-link-lib`
    lines semantically significant (and potentially even require specifying
    some libraries twice), wrap each set of libraries in linker groups. This
    ensures that symbols in all libraries resolve correctly regardless of
    library order.
    
    Linker groups of reasonable sizes don't have a substantial cost, but
    putting the entirey of a large link line inside a linker group can
    add enough cost to be noticeable. To minimize the cost of linker groups,
    use separate groups for local native libraries, upstream crates, and
    upstream native libraries. This doesn't allow backreferences between
    those groups, but in most cases we won't want such backreferences.
    joshtriplett committed Jun 23, 2021
    Configuration menu
    Copy the full SHA
    9ef7d70 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2021

  1. rustc_codegen_ssa: Drop lang_item_to_crate and missing_lang_items

    These fields were both only used for library ordering, so they're now
    both unused.
    joshtriplett committed Jun 25, 2021
    Configuration menu
    Copy the full SHA
    09b4e49 View commit details
    Browse the repository at this point in the history