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

bpf-linker is not compatbile with -fuse-ld #194

Open
addisoncrump opened this issue Apr 8, 2024 · 1 comment
Open

bpf-linker is not compatbile with -fuse-ld #194

addisoncrump opened this issue Apr 8, 2024 · 1 comment

Comments

@addisoncrump
Copy link

I encountered this while trying to run aya-rs/aya#916 locally.

warning: [email protected]:   = note: ... "-fuse-ld=mold"
warning: [email protected]:   = note: error: unexpected argument '-f' found
warning: [email protected]:           
warning: [email protected]:             tip: to pass '-f' as a value, use '-- -f'
warning: [email protected]:           
warning: [email protected]:           Usage: bpf-linker [OPTIONS] --output <OUTPUT> [INPUTS]...
warning: [email protected]:           
warning: [email protected]:           For more information, try '--help'.

This is because I use the mold linker locally in my cargo.toml:

[target.x86_64-unknown-linux-gnu]
rustflags = [
    "-C", "link-arg=-fuse-ld=mold",
]

Confusingly, I only have this set for when the target is x86_64. Is this another bug?

@tamird
Copy link
Member

tamird commented Oct 18, 2024

That's a cargo-in-cargo bug indeed. RUSTFLAGS has a very high priority, so it ends up winning out over the linker specified in the integration-ebpf crate. Can you use linker = "mold" instead?

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

No branches or pull requests

2 participants