Skip to content

rust: Use --print native-static-libs to collect dependencies of staticlib library targets #11789

Open
@sdroege

Description

Currently meson requires listing dependencies of staticlib library targets manually, which is error prone at best. The correct way would be to let rustc provide these dependencies via the --print native-static-libs commandline parameter.

Unfortunately this requires putting a wrapper around rustc for this case and parsing something from stdout. Also unfortunately it's placed in between any other output.

The output is for example

note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions