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

Issue linking attiny202 #422

Closed
DeepHorizons opened this issue Jun 3, 2023 · 1 comment
Closed

Issue linking attiny202 #422

DeepHorizons opened this issue Jun 3, 2023 · 1 comment

Comments

@DeepHorizons
Copy link

When trying to target a new device in the hal, the ATTiny202, I get a compiler error about the linker. I tried changing the MCU type to avrxmega3 but that caused different errors. Here is the log:

error: linking with `avr-gcc` failed: exit status: 1                                                                                                          
  |                                                                                                                                                           
  = note: LC_ALL="C" PATH="/home/josh/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/josh/.cargo/bin:/home
/josh/.local/bin:/home/josh/.cargo/bin:/home/josh/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/home/josh/.local/share/flatpak/exports/bin:/var/lib/flat
pak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "avr-gcc" "-mmcu=attiny202" "/tmp/rustcPUIP
Nu/symbols.o" "/home/josh/deleteme/rust-embeded-test-attint402/target/avr-attiny202/debug/deps/rust_embeded_test_attint402-0821c1a01a28d416.panic_halt-9fb55b3
64d5215ff.panic_halt.3b8ea78f5b1f46a7-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "/home/josh/deleteme/rust-embeded-test-attint402/target/avr-attiny202/debug/
deps" "-L" "/home/josh/deleteme/rust-embeded-test-attint402/target/debug/deps" "-L" "/home/josh/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustli
b/avr-attiny202/lib" "-Wl,-Bstatic" "/home/josh/deleteme/rust-embeded-test-attint402/target/avr-attiny202/debug/deps/libcompiler_builtins-ed5dabdc4bb102ce.rli
b" "-Wl,-Bdynamic" "-lgcc" "-Wl,-z,noexecstack" "-L" "/home/josh/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-attiny202/lib" "-o" "/hom
e/josh/deleteme/rust-embeded-test-attint402/target/avr-attiny202/debug/deps/rust_embeded_test_attint402-0821c1a01a28d416.elf" "-Wl,--gc-sections" "-no-pie"   
  = note: /usr/bin/avr-ld: cannot find crtattiny202.o: No such file or directory                                                                   
          /usr/bin/avr-ld: cannot find -lattiny202: No such file or directory                                                                                 
          collect2: error: ld returned 1 exit status

There is no crtattiny202.o in my /usr/avr/lib/avrxmega3 folder, just a libc.a file. I do have a crtattiny202.o in an arduino folder on my PC, in /var/lib/flatpak/app/cc.arduino.arduinoide/x86_64/stable/96e4cef0c12962b6a56b7cd414456d730684a75e90f3f2a2416d36db1c2fde26/files/Arduino/hardware/tools/avr/avr/lib/avrxmega3/short-calls/crtattiny202.o, I do not have the same in my avrxmega3 folder.

@DeepHorizons
Copy link
Author

This ended up being an issue with avr-libc as it has support but not in a released version yet. There is also an issue with linking that can be worked around using nightly-2022-10-20. The linking issue should be solved in rust-lang/rust#106619

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

1 participant