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

no memory region specified for section '.eh_frame' (Ubuntu 16 i686) #96

Open
advancedwebdeveloper opened this issue Nov 10, 2020 · 14 comments

Comments

@advancedwebdeveloper
Copy link

Hi.
I believe you know the cause of this bug.

@ryankurte
Copy link

i am not at all sure this is it but, usually with ARM we specify the GNU/gcc linker rather than LLD with .cargo/config:

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

have you tried building with the appropriate GNU linker for riskv?

also may be related to: rust-embedded/wg#36 (comment)

@advancedwebdeveloper
Copy link
Author

~/Desktop/rust-sipeed-longan-nano-master$ cargo build
Compiling r0 v0.2.2
Compiling panic-abort v0.3.1
Compiling rust-sipeed-longan-nano v0.1.0 (/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master)
warning: unnecessary parentheses around assigned value
--> src/main.rs:8:25
|
8 | const rcu_apb2en: u32 = (0x4002_1000 + 0x18);
| ^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: #[warn(unused_parens)] on by default

warning: unnecessary parentheses around assigned value
--> src/main.rs:10:25
|
10 | const gpioa_ctl0: u32 = (0x4001_0800 + 0x0);
| ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around assigned value
--> src/main.rs:11:25
|
11 | const gpioa_data: u32 = (0x4001_0800 + 0xc);
| ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unused import: panic_abort
--> src/main.rs:13:5
|
13 | use panic_abort;
| ^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: constant rcu_apb2en should have an upper case name
--> src/main.rs:8:7
|
8 | const rcu_apb2en: u32 = (0x4002_1000 + 0x18);
| ^^^^^^^^^^ help: convert the identifier to upper case: RCU_APB2EN
|
= note: #[warn(non_upper_case_globals)] on by default

warning: constant gpioa_ctl0 should have an upper case name
--> src/main.rs:10:7
|
10 | const gpioa_ctl0: u32 = (0x4001_0800 + 0x0);
| ^^^^^^^^^^ help: convert the identifier to upper case: GPIOA_CTL0

warning: constant gpioa_data should have an upper case name
--> src/main.rs:11:7
|
11 | const gpioa_data: u32 = (0x4001_0800 + 0xc);
| ^^^^^^^^^^ help: convert the identifier to upper case: GPIOA_DATA

error: linking with riscv32-unknown-elf-gcc failed: exit code: 1
|
= note: "riscv32-unknown-elf-gcc" "-L" "/home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.19pbfx1e7ppiz22i.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1gxn96a4ynn6krtc.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1rrq47tcmo7r1d7q.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.2oywxm1qwyrau2j5.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.36wqpyrxaht0bqyw.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.4g879aqcx3v63xcn.rcgu.o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.hpztk5fc5xtxkyj.rcgu.o" "-o" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps" "-L" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/debug/deps" "-L" "/home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-Wl,-Bstatic" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libr0-c85b5ab54aceb5f9.rlib" "-Wl,--start-group" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib" "/home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/librustc_std_workspace_core-1bd0d3673780d693.rlib" "/home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-5aec724f1f867fb1.rlib" "-Wl,--end-group" "/home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib" "-Tlink.x" "-Wl,-Bdynamic"
= note: /usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.19pbfx1e7ppiz22i.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.19pbfx1e7ppiz22i.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1gxn96a4ynn6krtc.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1gxn96a4ynn6krtc.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1rrq47tcmo7r1d7q.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.1rrq47tcmo7r1d7q.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.2oywxm1qwyrau2j5.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.2oywxm1qwyrau2j5.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.36wqpyrxaht0bqyw.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.36wqpyrxaht0bqyw.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.4g879aqcx3v63xcn.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.4g879aqcx3v63xcn.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.hpztk5fc5xtxkyj.rcgu.o: can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/rust_sipeed_longan_nano-2df4b3c694b8dfb5.hpztk5fc5xtxkyj.rcgu.o
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-5aec724f1f867fb1.rlib(core-5aec724f1f867fb1.core.aewkdyag-cgu.0.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-5aec724f1f867fb1.rlib(core-5aec724f1f867fb1.core.aewkdyag-cgu.0.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib(panic_abort-37322ac1e75fee7c.panic_abort.9h2oa02d-cgu.0.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib(panic_abort-37322ac1e75fee7c.panic_abort.9h2oa02d-cgu.0.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.107.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.107.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.21.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.21.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.27.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.27.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.39.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.39.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.41.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.41.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.70.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.70.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.73.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.73.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.75.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.75.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.78.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.78.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.80.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.80.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.87.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.87.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.93.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.93.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.98.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.98.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.125.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.125.rcgu.o)
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.17.rcgu.o): can't link soft-float modules with double-float modules
/usr/local/lib/gcc/riscv32-unknown-elf/10.2.0/../../../../riscv32-unknown-elf/bin/ld: failed to merge target specific data of file /home/oceanfish81/.rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib(compiler_builtins-deaf2d068ddf18c0.compiler_builtins.7egkskwx-cgu.17.rcgu.o)
collect2: error: ld returned 1 exit status

error: aborting due to previous error; 7 warnings emitted

error: could not compile rust-sipeed-longan-nano

To learn more, run the command again with --verbose.

@advancedwebdeveloper
Copy link
Author

advancedwebdeveloper commented Nov 12, 2020

That's with

[target.riscv32imac-unknown-none-elf]
linker = "riscv32-unknown-elf-gcc"

@advancedwebdeveloper
Copy link
Author

However with

[target.riscv32imac-unknown-none-elf]
linker = "riscv32-unknown-elf-ld"

I didn't get any error:

$ cargo build
Compiling panic-abort v0.3.1
Compiling r0 v0.2.2
Compiling rust-sipeed-longan-nano v0.1.0 (/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master)
warning: unnecessary parentheses around assigned value
--> src/main.rs:8:25
|
8 | const rcu_apb2en: u32 = (0x4002_1000 + 0x18);
| ^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: #[warn(unused_parens)] on by default

warning: unnecessary parentheses around assigned value
--> src/main.rs:10:25
|
10 | const gpioa_ctl0: u32 = (0x4001_0800 + 0x0);
| ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around assigned value
--> src/main.rs:11:25
|
11 | const gpioa_data: u32 = (0x4001_0800 + 0xc);
| ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unused import: panic_abort
--> src/main.rs:13:5
|
13 | use panic_abort;
| ^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: constant rcu_apb2en should have an upper case name
--> src/main.rs:8:7
|
8 | const rcu_apb2en: u32 = (0x4002_1000 + 0x18);
| ^^^^^^^^^^ help: convert the identifier to upper case: RCU_APB2EN
|
= note: #[warn(non_upper_case_globals)] on by default

warning: constant gpioa_ctl0 should have an upper case name
--> src/main.rs:10:7
|
10 | const gpioa_ctl0: u32 = (0x4001_0800 + 0x0);
| ^^^^^^^^^^ help: convert the identifier to upper case: GPIOA_CTL0

warning: constant gpioa_data should have an upper case name
--> src/main.rs:11:7
|
11 | const gpioa_data: u32 = (0x4001_0800 + 0xc);
| ^^^^^^^^^^ help: convert the identifier to upper case: GPIOA_DATA

warning: 7 warnings emitted

Finished dev [unoptimized + debuginfo] target(s) in 0.95s

@advancedwebdeveloper
Copy link
Author

I am able to see the binary file, as described here - it is just I have my toolchain offers "riscv32-unknown-elf" prefix, for the executibles, instead of "riscv-nuclei-elf-"

@ryankurte
Copy link

ahh can't link soft-float modules with double-float modules is familiar, though i can't find the issues i tracked down to solve this. on armhf this is sometimes resolved by adding a linker path to the correct libraries for the ABI, something like this in .cargo/config from an armhf project of mine:

[target.thumbv7em-none-eabihf]

rustflags = [
   "-C", "linker=arm-none-eabi-gcc",
   "-C", "link-arg=-L/usr/lib/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/",
]

I am able to see the binary file, as described here - it is just I have my toolchain offers "riscv32-unknown-elf" prefix, for the executibles, instead of "riscv-nuclei-elf-"

great! you should just be able to change file paths then?

@advancedwebdeveloper
Copy link
Author

ahh can't link soft-float modules with double-float modules is familiar, though i can't find the issues i tracked down to solve this. on armhf this is sometimes resolved by adding a linker path to the correct libraries for the ABI, something like this in .cargo/config from an armhf project of mine:

[target.thumbv7em-none-eabihf]

rustflags = [
   "-C", "linker=arm-none-eabi-gcc",
   "-C", "link-arg=-L/usr/lib/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/",
]

@lupyuen , could you help here?

Let's ask those who know how to do that properly.

I am able to see the binary file, as described here - it is just I have my toolchain offers "riscv32-unknown-elf" prefix, for the executibles, instead of "riscv-nuclei-elf-"

great! you should just be able to change file paths then?
Not really.
After replacing "-gcc" with "-ld" I got a binary, on the output - but has an oddly small size (a bit larger then 1 KB, compared to 20+ KB for known firmware binaries.)
After downloading via DFU my Longan Nano does not boot even a LED related demo project.
Something is wrong.

CC @zsdonghao @junhuanchen @myuanz @QinYUN575 @btx000 @pcotret @Zepan @MindShow

@luojia65
Copy link

It says can't link soft-float modules with double-float modules, what could this 'double-float module' be? There's no float and double extension in rust's riscv32imac target.

@advancedwebdeveloper
Copy link
Author

I could try to reproduce again an share all generated artifacts

@pcotret
Copy link

pcotret commented Nov 13, 2020

After downloading via DFU my Longan Nano does not boot even a LED related demo project.
Something is wrong.
CC @zsdonghao @junhuanchen @myuanz @QinYUN575 @btx000 @pcotret @Zepan @MindShow

The only problem I had related to this was that my Longan Nano was kinda stuck.
https://github.com/sipeed/Longan-DOC/blame/master/en/get_started/blink.md#L104

Development board hold down the BOOT key, then press the RESET button to restart development board and then release the BOOT button to enter DFU mode.

@therealprof
Copy link
Contributor

i am not at all sure this is it but, usually with ARM we specify the GNU/gcc linker rather than LLD with .cargo/config:

Who is "we" and why are you doing that?

@advancedwebdeveloper
Copy link
Author

I see that something is rather wrong with the config.

For instance I tried to build https://github.com/pdx-cs-rust/nanoball - but it failed, with my recent ~/.cargo/config file.
Once I removed it (but didn't touch anything inside ./.cargo/config file ) - I was able to build the project.
I see the animation on Longan Nano's LCD screen, right now.

@ryankurte
Copy link

Who is "we" and why are you doing that?

org project, because inexplicably when you start linking external c libraries the linker seems to break in a variety of horrifying ways / stop being able to infer a bunch of things like this correctly.

what could this 'double-float module' be

oh yeah this is, v different from what i was thinking.

@advancedwebdeveloper
Copy link
Author

@barafael , experiencing an uncertain situation with your demos:
barafael/rust-sipeed-longan-DAC#1

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

5 participants