Skip to content

Linking an rlib with a dylib may not actually link the rlib #14344

Closed
@alexcrichton

Description

@alexcrichton

When linking an rlib to a dylib, it must be required that the object file for the rlib is included in the dylib. Linkers will optimize away the object file if the dylib doesn't actually use any symbols from the rlib.

Downstream consumers of the rlib (using the rlib through the dylib) may want the symbols, ending up with linker errors.

Basically, we need to tell linkers to force inclusion of all objects from an rlib into a dylib. I think this also applies to native objects inside of an rlib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binaries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions