rust-lang/compiler-builtins

multiple rlib candidates for compiler_builtins found

AthiraRamakrishna opened this issue · 4 comments

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 commented

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

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 commented

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.

This worked, thank you!