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

Link to libgcc when statically linking musl #1034

Merged
merged 1 commit into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ cfg_if! {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(target_env = "musl")] {
// On some architectures (e.g. aarch64) musl depends on some libgcc
// functions (__addtf3, __multf3, __subtf3) for long double arithmetic
// that it uses internally. Unfortunately we don't provide these
// functions in compiler-builtins, so we instead need to get them from
// libgcc.
//
// This is not a problem if we are linking to libc dynamically since the
// libgcc dependency will automatically get picked up by the linker
// then.
#[cfg_attr(feature = "stdbuild",
link(name = "gcc", kind = "static",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "stdbuild",
link(name = "c", kind = "static",
cfg(target_feature = "crt-static")))]
Expand Down