Skip to content

[AVR] cannot find -lgcc when using Arduino avr-ld version #146668

Open
@tomtor

Description

@tomtor
tom@swan-ubu20:~/src/rust/arduino-hal-test/bug$ which avr-ld

/home/tom/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-ld

tom@swan-ubu20:~/src/rust/arduino-hal-test/bug$ clang -v -target avr-none -mmcu=attiny84 bad_copy_data.c
clang version 21.0.0git (git@github.com:tomtor/llvm-project.git ee414e35047c588daba1ee62e8291ea171700f43)
Target: avr-none
Thread model: posix
InstalledDir: /media/scratch/rust/llvm-project/build/bin
Build config: +unoptimized, +assertions
 "/media/scratch/rust/llvm-project/build/bin/clang-21" -cc1 -triple avr-none -emit-obj -dumpdir a- -disable-f
ree -clear-ast-before-backend -main-file-name bad_copy_data.c -mrelocation-model static -mframe-pointer=all -
fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -fno-use-init-array -fno-use-cxa-atexit
 -target-cpu attiny84 -debugger-tuning=gdb -fdebug-compilation-dir=/home/tom/src/rust/arduino-hal-test/bug -v
 -fcoverage-compilation-dir=/home/tom/src/rust/arduino-hal-test/bug -resource-dir /media/scratch/rust/llvm-pr
oject/build/lib/clang/21 -internal-isystem /usr/lib/avr/include -ferror-limit 19 -fmessage-length=109 -fgnuc-
version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -faddrsig -o /tmp/bad_copy_data-274bb1.o -x c bad_c
opy_data.c
clang -cc1 version 21.0.0git based upon LLVM 21.0.0git default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/avr/include
 /usr/local/include
 /media/scratch/rust/llvm-project/build/lib/clang/21/include
 /usr/include
End of search list.
 "/home/tom/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-ld" -o a.out --gc-sec
tions -L/usr/lib/avr/lib/avr25 -L/avr25 --defsym=__DATA_REGION_ORIGIN__=0x800060 --start-group -l:crtattiny84
.o -lgcc -lm -lc -lattiny84 /tmp/bad_copy_data-274bb1.o --end-group --relax -mavr25
/home/tom/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-ld: cannot find -lgcc
clang: error: avr-ld command failed with exit code 1 (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions