Skip to content

Link failed because of different floating-point ABI #4

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

Closed
smsxgli opened this issue May 25, 2021 · 4 comments
Closed

Link failed because of different floating-point ABI #4

smsxgli opened this issue May 25, 2021 · 4 comments

Comments

@smsxgli
Copy link

smsxgli commented May 25, 2021

Hi everybody, i am a new guy for both risc-v and rust.
I have tried this example with newest stable rust 1.52.1. I just cloned this repo, and type cargo build, then it failed with some error such as "private mod" and so on. This is corrected by replacing k210-hal's version with git address, this change can be found in diff.txt, which is the output of git diff Cargo.toml.
But then, I try cargo build, there is a link error:

error: linking with rust-lld failed: exit code: 1
...// some long error about object file and link param

error: linking with rust-lld failed: exit code: 1

= note: rust-lld: error: /tmp/k210-example/target/riscv64gc-unknown-none-elf/debug/deps/libriscv-0cd34d7ac3269d39.rlib(riscv.o): cannot link object files with different floating-point ABI
rust-lld: error: /tmp/k210-example/target/riscv64gc-unknown-none-elf/debug/deps/libriscv_rt-35242cf52d273fa0.rlib(riscv-rt.o): cannot link object files with different floating-point ABI

error: aborting due to previous error

error: could not compile k210-example

here is the full output
output.txt

BTW, The components i have installed list below:
cargo-x86_64-unknown-linux-gnu (installed)
clippy-x86_64-unknown-linux-gnu (installed)
llvm-tools-preview-x86_64-unknown-linux-gnu (installed)
rust-docs-x86_64-unknown-linux-gnu (installed)
rust-src (installed)
rust-std-riscv64gc-unknown-none-elf (installed)
rust-std-x86_64-unknown-linux-gnu (installed)
rustc-x86_64-unknown-linux-gnu (installed)
rustfmt-x86_64-unknown-linux-gnu (installed)

if there is any information is missed here, please let me know.

In my opinion, K210 use lp64f abi, which is unusual. For risc-v64, lp64d abi is more common.

@Disasm
Copy link
Member

Disasm commented May 25, 2021

I believe it's a problem with riscv & riscv-rt crates: rust-embedded/riscv#69

@smsxgli
Copy link
Author

smsxgli commented May 25, 2021

thanks for reply! so since this is a upstream problem, should i close this issue?

@Disasm
Copy link
Member

Disasm commented May 25, 2021

We can leave it open until the problem is resolved.

@smsxgli
Copy link
Author

smsxgli commented Sep 11, 2021

i am sure latest riscv crate(version 0.7.0) solved this issue. thank you guys!

@smsxgli smsxgli closed this as completed Sep 11, 2021
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