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

build error rv32imc which does not have atomics at all #326

Closed
rminnich opened this issue Nov 15, 2019 · 5 comments
Closed

build error rv32imc which does not have atomics at all #326

rminnich opened this issue Nov 15, 2019 · 5 comments

Comments

@rminnich
Copy link

Please see oreboot/oreboot#189

we are compiling to the lowrisc/ibex cpu used in the opentitan earlygrey soc. This is an r32imc, i.e. no atomics.

This is similar to the just-closed issue for rv64, which had no atomic load-store for u16.

error: linking with rust-lld failed: exit code: 1
|
= note: "rust-lld" "-flavor" "gnu" "-L" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/riscv32imc-unknown-none-elf/release/deps/crb-d971ec7d0b119a72.crb.ae8f5638-cgu.3.rcgu.o" "-o" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/riscv32imc-unknown-none-elf/release/deps/crb-d971ec7d0b119a72" "--gc-sections" "-L" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/riscv32imc-unknown-none-elf/release/deps" "-L" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/release/deps" "-L" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib" "-Bstatic" "/home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib/libcompiler_builtins-ddf3439031b17ea4.rlib" "-Tlink.ld" "-Bdynamic"

= note: rust-lld: error: undefined symbol: __atomic_load_1
>>> referenced by compiler_builtins.bsqadl41-cgu.7
>>> compiler_builtins-ddf3439031b17ea4.compiler_builtins.bsqadl41-cgu.7.rcgu.o:(__llvm_memcpy_element_unordered_atomic_1) in archive /home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib/libcompiler_builtins-ddf3439031b17ea4.rlib
>>> referenced by compiler_builtins.bsqadl41-cgu.7
>>> compiler_builtins-ddf3439031b17ea4.compiler_builtins.bsqadl41-cgu.7.rcgu.o:(__llvm_memmove_element_unordered_atomic_1) in archive /home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib/libcompiler_builtins-ddf3439031b17ea4.rlib
>>> referenced by compiler_builtins.bsqadl41-cgu.7
>>> compiler_builtins-ddf3439031b17ea4.compiler_builtins.bsqadl41-cgu.7.rcgu.o:(__llvm_memmove_element_unordered_atomic_1) in archive /home/ryan/repos/oreboot/src/mainboard/opentitan/crb/target/sysroot/lib/rustlib/riscv32imc-unknown-none-elf/lib/libcompiler_builtins-ddf3439031b17ea4.rlib

@alexcrichton
Copy link
Member

Thanks for this! It should be fixed in 0.1.21 in theory, can you check what version you're using?

@rminnich
Copy link
Author

rminnich@xcpu:~/projects/oreboot/oreboot/src/mainboard/opentitan/crb$ more .cargo/config
[build]
target = "riscv32imc-unknown-none-elf"

[target.riscv32imc-unknown-none-elf]
rustflags = [
"-C", "link-arg=-Tlink.ld",
]
rminnich@xcpu:~/projects/oreboot/oreboot/src/mainboard/opentitan/crb$ rustc --version
rustc 1.41.0-nightly (82cf3a448 2019-11-14)

did we misconfigure something?

@alexcrichton
Copy link
Member

Unfortunately that's not quite enough information to go on. Without more information about how to reproduce and knowing what version of this crate you're using I won't be able to help.

@rminnich
Copy link
Author

it seems to be fixed anyway. You all fix bugs faster than I can write readable bug reports it seems :-)

@bjorn3
Copy link
Member

bjorn3 commented Nov 18, 2019

Probably fixed in #324.

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

3 participants