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

don't link libc #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

don't link libc #4

wants to merge 1 commit into from

Conversation

Twey
Copy link

@Twey Twey commented Sep 7, 2021

It is not necessary to link libc manually, as libc is already
contained in liblibc.rlib which gets linked in automatically.

This link annotation is harmful as in static situations (where
target_feature="crt-static") it will force linking the dynamic libc,
producing chimera binaries or breaking the build entirely.

It is not necessary to link libc manually, as libc is already
contained in `liblibc.rlib` which gets linked in automatically.

This link annotation is harmful as in static situations (where
target_feature="crt-static") it will force linking the dynamic libc,
producing chimera binaries or breaking the build entirely.
@yuqitao
Copy link

yuqitao commented Sep 9, 2021

I built my project with cargo build --release --target aarch64-unknown-linux-musl.
I got this rust-lang/rust#46651 first. So I add rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]. then build successfully. But when I run it, I got Segmentation fault. It seems that we can solve this problem with your commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants