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

Compiler Rejects Floats (Defined twice?) #582

Closed
Tellurian-Ul opened this issue Sep 17, 2024 · 3 comments
Closed

Compiler Rejects Floats (Defined twice?) #582

Tellurian-Ul opened this issue Sep 17, 2024 · 3 comments
Labels
compiler-bug Not a bug in avr-hal, but a bug in the rust compiler/LLVM

Comments

@Tellurian-Ul
Copy link

Tellurian-Ul commented Sep 17, 2024

Possibly related to #566.

I'm unable to compile when floats are introduced to my code. I'm currently relying on nightly-2024-07-25 given the broken state of the compiler. I've posted the error I'm seeing upon cargo build below. My best guess is that the nightly override somehow created two definitions of floating point operations?

error: linking with `avr-gcc` failed: exit code: 1
  |
  = note: "avr-gcc" "-mmcu=atmega328p" "C:\\User\\AppData\\Local\\Temp\\rustcZfgPO9\\symbols.o" "C:\\User\\project\\target\\avr-atmega328p\\debug\\deps\\project-0e3cb22c69115045.dht11-23173e3f7edbd950.dht11.3e7d5a656d0319e8-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "C:\\User\\project\\target\\avr-atmega328p\\debug\\deps" "-L" "C:\\User\\project\\target\\debug\\deps" "-L" "C:\\User\\.rustup\\toolchains\\nightly-2024-07-25-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-Wl,-Bstatic" "C:\\Userr\\project\\target\\avr-atmega328p\\debug\\deps\\libcompiler_builtins-d2fcaf6386bb018a.rlib" "-Wl,-Bdynamic" "-lgcc" "-Wl,-z,noexecstack" "-L" "C:\\User\\.rustup\\toolchains\\nightly-2024-07-25-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-o" "C:\\User\\project\\target\\avr-atmega328p\\debug\\deps\\project-0e3cb22c69115045.elf" "-Wl,--gc-sections" "-no-pie"
  = note: C:/User/AppData/Local/Microsoft/WinGet/Packages/ZakKemble.avr-gcc_Microsoft.Winget.Source_8wekyb3d8bbwe/avr-gcc-13.2.0-x64-windows/bin/../lib/gcc/avr/13.2.0/../../../../avr/bin/ld.exe: C:/User/AppData/Local/Microsoft/WinGet/Packages/ZakKemble.avr-gcc_Microsoft.Winget.Source_8wekyb3d8bbwe/avr-gcc-13.2.0-x64-windows/bin/../lib/gcc/avr/13.2.0/../../../../avr/lib/avr5\libm.a(addsf3.o): in function `__addsf3':
          (.text.avr-libc.fplib+0x2): multiple definition of `__addsf3'; C:\User\project\target\avr-atmega328p\debug\deps\libcompiler_builtins-d2fcaf6386bb018a.rlib(compiler_builtins-d2fcaf6386bb018a.compiler_builtins.fee158677b5537c-cgu.13.rcgu.o):C:\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\compiler_builtins-0.1.109/src/macros.rs:500: first defined here
          collect2.exe: error: ld returned 1 exit status


error: could not compile `project` (bin "project") due to 1 previous error

Does anyone know if there's a fix that allows floats?

@Rahix Rahix added the compiler-bug Not a bug in avr-hal, but a bug in the rust compiler/LLVM label Sep 17, 2024
@Rahix
Copy link
Owner

Rahix commented Sep 20, 2024

Is this a duplicate of #541 maybe?

@Tellurian-Ul
Copy link
Author

Is this a duplicate of #541 maybe?

Looks like it. Probably safe to close this issue.

@stappersg
Copy link
Contributor

Probably safe to close this issue.

Please do.

@Tellurian-Ul do known that on github.com one can close the issues that are opened by themself.

@Rahix Rahix closed this as completed Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-bug Not a bug in avr-hal, but a bug in the rust compiler/LLVM
Projects
None yet
Development

No branches or pull requests

3 participants