rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
95.18k stars 12.27k forks source link

linking with rust-lld failed: exit code: 1 #73284

Open imran82ali opened 4 years ago

imran82ali commented 4 years ago

Dear Experts, I am working on Discovery repository, I am building this for STM32F3 Discovery. I am facing following error linking with rust-lld failed: exit code: 1

When I am building by

cargo build --target thumbv7em-none-eabihf

It was working fine a couple of weeks ago, I am using Linux 18.04 LTS, I have updated rust my current version is

imran82ali@gmail:~$ rustup --version --verbose rustup 1.21.1 (7832b2ebe 2019-12-20)

imran82ali@gmail:~$ rustc --version --verbose rustc 1.44.0 (49cae5576 2020-06-01) binary: rustc commit-hash: 49cae55760da0a43428eba73abcb659bb70cf2e4 commit-date: 2020-06-01 host: x86_64-unknown-linux-gnu release: 1.44.0 LLVM version: 9.0

Looking forward for your response. Thanks, IMRAN ALI

spastorino commented 4 years ago

@imran82ali can you provide more details so we can reproduce the issue?. Would be great if you provide an MCVE but at least if you can share a repo where the issue can be reproduced it would be great. For now this is not actionable.

BilalChaudry9 commented 3 years ago

Hello, I am quite new on Embedded Rust.. Previously I had complied a few programs that worked file.. But Today when creating a new one it started throwing error **error: linking with rust-lld failed: exit code: 1** Even the Discovery src projects are causing the issues. When I open previously compiled projects they were running fine until I Updated the Crates using "cargo update" and programs also started throwing same error.

The rustup Version is: rustup --version --verbose rustup 1.22.1 (b01adbbc3 2020-07-08)

The rustc version is: rustc --version --verbose rustc 1.46.0 (04488afe3 2020-08-24) binary: rustc commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9 commit-date: 2020-08-24 host: x86_64-pc-windows-msvc release: 1.46.0 LLVM version: 10.0

Following is the Error Output while building the project using cargo build --target thumbv7em-none-eabihf --verbose

Compiling aux7 v0.1.0 (W:\Projects\STM32F3_W_Rust\registers\auxiliary) Running rustc --crate-name aux7 --edition=2018 auxiliary\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=850439722fdcf033 -C extra-filename=-850439722fdcf033 --out-dir W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps --target thumbv7em-none-eabihf -C incremental=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\incremental -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\debug\deps --extern cortex_m=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-1107f8ab68e8603f.rmeta --extern cortex_m_rt=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m_rt-99ee748640718873.rmeta --extern f3=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libf3-4ead8fd2befc06ac.rmeta --extern panic_itm=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libpanic_itm-28781bcac7201082.rmeta -C link-arg=-Tlink.x -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-62cf7c75579b0f0a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-rt-4aa04597be3672b3\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\f3-517cae8ef6c5293a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-7703d915492b9b6b\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\stm32f30x-a585ec9044842127\out

Compiling registers v0.1.0 (W:\Projects\STM32F3_W_Rust\registers) Runningrustc --crate-name registers --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=7878afffa1a4febc -C extra-filename=-7878afffa1a4febc --out-dir W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps --target thumbv7em-none-eabihf -C incremental=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\incremental -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\debug\deps --extern aux7=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libaux7-850439722fdcf033.rlib -C link-arg=-Tlink.x -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-62cf7c75579b0f0a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-rt-4aa04597be3672b3\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\f3-517cae8ef6c5293a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-7703d915492b9b6b\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\stm32f30x-a585ec9044842127\out`

error: linking withrust-lld` failed: exit code: 1 | = note: "rust-lld" "-flavor" "gnu" "--eh-frame-hdr" "-L" "C:\Users\AbdulRafey\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\thumbv7em-none-eabihf\lib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\registers-7878afffa1a4febc.j0pwunhdg0er6fr.rcgu.o" "-o" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\registers-7878afffa1a4febc" "--gc-sections" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\debug\deps" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-62cf7c75579b0f0a\out" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-rt-4aa04597be3672b3\out" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\f3-517cae8ef6c5293a\out" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-7703d915492b9b6b\out" "-L" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\stm32f30x-a585ec9044842127\out" "-L" "C:\Users\AbdulRafey\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\thumbv7em-none-eabihf\lib" "-Bstatic" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libaux7-850439722fdcf033.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libf3-4ead8fd2befc06ac.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libstm32f30x_hal-2f536e37c1bb2e66.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libstm32f30x-e315706793905d17.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libaligned-968bbc8e9427c381.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\liblsm303dlhc-2e48e31df9958b28.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcast-ea4bfe338ed04961.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libl3gd20-6c0e7e2259910900.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libgeneric_array-b2799ed9eb05f11c.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m_rt-99ee748640718873.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libr0-5dbba35f7171addd.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-1107f8ab68e8603f.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libaligned-9b00dc44c54fc3e4.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libas_slice-4ba716ccb6fe2304.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libstable_deref_trait-8ca434fc758ace0b.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libgeneric_array-6081bd97d458c271.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libgeneric_array-b7a4a27b89be0632.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libgeneric_array-c9802107702be0ef.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libtypenum-76e71817d73bceed.rlib" "--start-group" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libpanic_itm-28781bcac7201082.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libembedded_hal-41d00d23c4839908.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libvoid-8178f791757a8f8b.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libnb-45dfcd7c55132bb2.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libnb-f13d8d92d6331327.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libvolatile_register-ce267508a56271be.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libvcell-852e99d7d146cb4d.rlib" "W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libbare_metal-b6db1529125f1e01.rlib" "C:\Users\AbdulRafey\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\thumbv7em-none-eabihf\lib\librustc_std_workspace_core-4660bc1cc2d1f3ce.rlib" "C:\Users\AbdulRafey\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\thumbv7em-none-eabihf\lib\libcore-9ef29c3c101dfd53.rlib" "--end-group" "C:\Users\AbdulRafey\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\thumbv7em-none-eabihf\lib\libcompiler_builtins-17b2875688712538.rlib" "-Tlink.x" "-Bdynamic" = note: rust-lld: error: duplicate symbol: __bkpt

defined at cortex-m.o:(.text.__bkpt+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib defined at inline.rs:13 (asm\inline.rs:13) bin/thumbv7em-none-eabihf.o:(.text.__bkpt+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __cpsid
      >>> defined at cortex-m.o:(.text.__cpsid+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:39 (asm\inline.rs:39)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__cpsid+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __cpsie
      >>> defined at cortex-m.o:(.text.__cpsie+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:50 (asm\inline.rs:50)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__cpsie+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __delay
      >>> defined at cortex-m.o:(.text.__delay+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:58 (asm\inline.rs:58)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__delay+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __dmb
      >>> defined at cortex-m.o:(.text.__dmb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:71 (asm\inline.rs:71)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__dmb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __dsb
      >>> defined at cortex-m.o:(.text.__dsb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:78 (asm\inline.rs:78)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__dsb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __isb
      >>> defined at cortex-m.o:(.text.__isb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:85 (asm\inline.rs:85)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__isb+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __msp_r
      >>> defined at cortex-m.o:(.text.__msp_r+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:92 (asm\inline.rs:92)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__msp_r+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __msp_w
      >>> defined at cortex-m.o:(.text.__msp_w+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:98 (asm\inline.rs:98)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__msp_w+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __nop
      >>> defined at cortex-m.o:(.text.__nop+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:114 (asm\inline.rs:114)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__nop+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __psp_r
      >>> defined at cortex-m.o:(.text.__psp_r+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:155 (asm\inline.rs:155)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__psp_r+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __psp_w
      >>> defined at cortex-m.o:(.text.__psp_w+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:161 (asm\inline.rs:161)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__psp_w+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __sev
      >>> defined at cortex-m.o:(.text.__sev+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:166 (asm\inline.rs:166)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__sev+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __wfe
      >>> defined at cortex-m.o:(.text.__wfe+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:176 (asm\inline.rs:176)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__wfe+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

      rust-lld: error: duplicate symbol: __wfi
      >>> defined at cortex-m.o:(.text.__wfi+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-bb2652376779cd11.rlib
      >>> defined at inline.rs:181 (asm\inline.rs:181)
      >>>            bin/thumbv7em-none-eabihf.o:(.text.__wfi+0x1) in archive W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libcortex_m-7fff91c354877e97.rlib

error: aborting due to previous error

error: could not compile registers.

Caused by: process didn't exit successfully: rustc --crate-name registers --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=7878afffa1a4febc -C extra-filename=-7878afffa1a4febc --out-dir W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps --target thumbv7em-none-eabihf -C incremental=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\incremental -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps -L dependency=W:\Projects\STM32F3_W_Rust\registers\target\debug\deps --extern aux7=W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\deps\libaux7-850439722fdcf033.rlib -C link-arg=-Tlink.x -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-62cf7c75579b0f0a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-rt-4aa04597be3672b3\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\f3-517cae8ef6c5293a\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\cortex-m-7703d915492b9b6b\out -L W:\Projects\STM32F3_W_Rust\registers\target\thumbv7em-none-eabihf\debug\build\stm32f30x-a585ec9044842127\out (exit code: 1) ` Regards,

TehseenHasan commented 3 years ago

I also have the same issue. When I build the src/05-led-roulette/src/main.rs code file. It builds fine with no errors. But when I try to build another code in The Led and Delay abstractions section of the Discovery book. (Code Link) that code gives this error: linking with rust-lld failed: exit code: 1

I am using Windows 10

The rustup Version is: rustup 1.23.1 (3df2264a9 2020-11-30)

The rustc Version is: rustc 1.48.0 (7eac88abb 2020-11-16)

TehseenHasan commented 3 years ago

Thanks, Sir @imran82ali Your solution worked for me. 👇👇👇 Download repo from here: https://github.com/rust-embedded/discovery then make these changes open code in VS Code in Auxillary folder there is cargo.toml file. there will be cortex-m crate, replace that with this: cortex-m = "=0.6.4"

Note. add = sign.