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

multiple rlib candidates for compiler_builtins found #712

Open
AthiraRamakrishna opened this issue Oct 16, 2024 · 4 comments
Open

multiple rlib candidates for compiler_builtins found #712

AthiraRamakrishna opened this issue Oct 16, 2024 · 4 comments

Comments

@AthiraRamakrishna
Copy link

Hi

I'm trying to build lc3-codec crate example sns_decode, for a custom target of riscv32, using cargo build -Zbuild-std=core and added compiler_builtins as dependency in the Cargo.toml

I get the error
Image

@tgross35 Any hint on this? it is similar to the issue #334

Thanks!

@bjorn3
Copy link
Member

bjorn3 commented Oct 16, 2024

Try -Zbuild-std=core,compiler_builtins and removing the explicit dependency on the compiler_builtins crate in Cargo.toml.

@AthiraRamakrishna
Copy link
Author

If I remove the explicit dependency from Cargo.toml and use -Zbuild-std=core,compiler_builtins then i get again rust-lld: error: undefined symbol: memcmp.

@bjorn3
Copy link
Member

bjorn3 commented Oct 16, 2024

Try also passing -Zbuild-std-features=compiler-builtins-mem to cargo. Or alternatively you can add -none to your target name to make compiler-builtins assume that your target is missing libc and automatically enable the mem feature.

@AthiraRamakrishna
Copy link
Author

This worked, thank you!

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