staticlib libgcc_s dependency requirement since 1.21.0 (nightly-2017-08-24) #55120
Labels
A-linkage
Area: linking into static, shared libraries and binaries
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi Rust team!
Since Rust 1.21.0 and nightly-2017-08-24 a new dependency,
libgcc_s
, is needed for static libraries we're building forgnu
,musl
andfreebsd
targets.This requirement slipped past us during a recent upgrade because the build process did not inform us of this new requirement. (I see this is an option
--print=native-static-libs
in the latest nightly (nightly-2018-10-10
) and unreleased 1.22.0.)The change was only visible to us upon linking to an Elixir app as a NIF during a two stage build process where on the second stage this particular library was absent. The error we see is:
From what I can tell this commit and its parent PR (#40113) seem related to this issue. According to the commit and PR the
libgcc_s
link requirement gets added for the musl target/to support dynamically-linked musl targets.However, we see this requirement listed on the latest nightly for the gnu and freebsd targets as well.
Was this libgcc_s link requirement intended for the gnu and freebsd targets as well? Or was this an unintended change?
Reproducible example project
To track the issue down I created an example project with a reproducible state. It allows building an example Rust staticlib for musl and link it to Elixir as a NIF. Instructions can be found in the README. I'm adding this to add context and show a scenario to show how this requirement breaks between versions.
https://github.com/tombruijn/rust-elixir-linking-issue-example-project
The text was updated successfully, but these errors were encountered: