riscv-rust / longan-nano

Board support package for the Longan Nano board
https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF103CBT6-Development-Board-p-4205.html
117 stars 30 forks source link

rust-lld: error: no memory region specified for section '.eh_frame', on Ubuntu 16 #15

Closed advancedwebdeveloper closed 3 years ago

advancedwebdeveloper commented 4 years ago

$ rustup target add riscv32imac-unknown-none-elf info: component 'rust-std' for target 'riscv32imac-unknown-none-elf' is up to date ~/Desktop/rust-sipeed-longan-nano-master$ rustup default nightly info: using existing install for 'nightly-i686-unknown-linux-gnu' info: default toolchain set to 'nightly-i686-unknown-linux-gnu'

nightly-i686-unknown-linux-gnu unchanged - rustc 1.49.0-nightly (1773f60ea 2020-11-08)

~/Desktop/rust-sipeed-longan-nano-master$ rustup target add riscv32imac-unknown-none-elf info: component 'rust-std' for target 'riscv32imac-unknown-none-elf' is up to date ~/Desktop/rust-sipeed-longan-nano-master$ rustup target add riscv32imac-unknown-none-elf info: component 'rust-std' for target 'riscv32imac-unknown-none-elf' is up to date oceanfish81@gollvm:~/Desktop/rust-sipeed-longan-nano-master$ cargo --verbose build Compiling r0 v0.2.2 Running rustc --crate-name r0 /home/oceanfish81/.cargo/registry/src/github.com-1285ae84e5963aae/r0-0.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=c85b5ab54aceb5f9 -C extra-filename=-c85b5ab54aceb5f9 --out-dir /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps --target riscv32imac-unknown-none-elf -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/debug/deps --cap-lints allow -C link-arg=-Tlink.x Compiling panic-abort v0.3.1 Running rustc --crate-name panic_abort /home/oceanfish81/.cargo/registry/src/github.com-1285ae84e5963aae/panic-abort-0.3.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=37322ac1e75fee7c -C extra-filename=-37322ac1e75fee7c --out-dir /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps --target riscv32imac-unknown-none-elf -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/debug/deps --cap-lints allow -C link-arg=-Tlink.x Compiling rust-sipeed-longan-nano v0.1.0 (/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master) Running rustc --crate-name rust_sipeed_longan_nano --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2df4b3c694b8dfb5 -C extra-filename=-2df4b3c694b8dfb5 --out-dir /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps --target riscv32imac-unknown-none-elf -C incremental=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/incremental -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/debug/deps --extern panic_abort=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib --extern r0=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libr0-c85b5ab54aceb5f9.rlib -C link-arg=-Tlink.x 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 rust-lld failed: exit code: 1 | = note: "rust-lld" "-flavor" "gnu" "-L" "/home/oceanfish81/snap/rustup/common/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" "--gc-sections" "-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/snap/rustup/common/rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-Bstatic" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libr0-c85b5ab54aceb5f9.rlib" "--start-group" "/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib" "/home/oceanfish81/snap/rustup/common/rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/librustc_std_workspace_core-1bd0d3673780d693.rlib" "/home/oceanfish81/snap/rustup/common/rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-5aec724f1f867fb1.rlib" "--end-group" "/home/oceanfish81/snap/rustup/common/rustup/toolchains/nightly-i686-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-deaf2d068ddf18c0.rlib" "-Tlink.x" "-Bdynamic" = note: rust-lld: error: no memory region specified for section '.eh_frame'

error: aborting due to previous error; 7 warnings emitted

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

Caused by: process didn't exit successfully: rustc --crate-name rust_sipeed_longan_nano --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2df4b3c694b8dfb5 -C extra-filename=-2df4b3c694b8dfb5 --out-dir /home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps --target riscv32imac-unknown-none-elf -C incremental=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/incremental -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps -L dependency=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/debug/deps --extern panic_abort=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_abort-37322ac1e75fee7c.rlib --extern r0=/home/oceanfish81/Desktop/rust-sipeed-longan-nano-master/target/riscv32imac-unknown-none-elf/debug/deps/libr0-c85b5ab54aceb5f9.rlib -C link-arg=-Tlink.x (exit code: 1)

advancedwebdeveloper commented 4 years ago

https://github.com/rust-embedded/riscv/issues/59 - cross-referencing with https://github.com/rust-lang/rust/pull/52787

Disasm commented 3 years ago

See https://github.com/rust-embedded/riscv/issues/59 for the relevant discussion