Seems like a strange compiler build.
In my opinion, the problem at the link stage: the object file after
compilation looks OK
Command line to compile the project:
$ avr-gcc -iquote . -Os -pipe -mmcu=attiny2313 -mint8 -g -c -o blink.o
blink.c
While I would not recommend using -mint8 (it has been deprecated for a
long time), the commandline looks basically OK.
Fine, I remove it.
You could add a -v to see more details.
Yes, two ctages: compiling and then linking:
1.$ avr-gcc -iquote . -Os -pipe -mmcu=attiny2313 -g -v -c -o blink.o blink.c
Using built-in specs.
Reading specs from /usr/lib/gcc/avr/4.9.2/device-specs/specs-attiny2313
COLLECT_GCC=avr-gcc
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++
--prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man
--bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib
--enable-shared --with-system-zlib --enable-long-long --enable-nls
--without-included-gettext --disable-libssp --build=i686-linux-gnu
--host=i686-linux-gnu --target=avr CFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' CPPFLAGS='-Wdate-time
-D_FORTIFY_SOURCE=2' CXXFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' FCFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' FFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' GCJFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' LDFLAGS=-Wl,-z,relro OBJCFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' OBJCXXFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat '
Thread model: single
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-iquote' '.' '-Os' '-pipe' '-g' '-v' '-c' '-o'
'blink.o' '-specs=device-specs/specs-attiny2313' '-mmcu=avr25' '-msp8'
/usr/lib/gcc/avr/4.9.2/cc1 -quiet -v -imultilib avr25/tiny-stack
-D__AVR_ATtiny2313__ -D__AVR_DEVICE_NAME__=attiny2313 -iquote . blink.c
-mn-flash=1 -mno-skip-bug -quiet -dumpbase blink.c -mmcu=avr25 -msp8
-auxbase-strip blink.o -g -Os -version -o - |
/usr/lib/gcc/avr/4.9.2/../../../avr/bin/as -mmcu=avr25 -mno-skip-bug
-o blink.o
GNU C (GCC) version 4.9.2 (avr)
compiled by GNU C version 6.2.0 20160914, GMP version 6.1.1,
MPFR version 3.1.4-p2, MPC version 1.0.3
warning: GMP header version 6.1.1 differs from library version 6.1.2.
warning: MPFR header version 3.1.4-p2 differs from library version 3.1.5.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/avr/4.9.2/../../../avr/sys-include"
#include "..." search starts here:
.
#include <...> search starts here:
/usr/lib/gcc/avr/4.9.2/include
/usr/lib/gcc/avr/4.9.2/include-fixed
/usr/lib/gcc/avr/4.9.2/../../../avr/include
End of search list.
GNU C (GCC) version 4.9.2 (avr)
compiled by GNU C version 6.2.0 20160914, GMP version 6.1.1,
MPFR version 3.1.4-p2, MPC version 1.0.3
warning: GMP header version 6.1.1 differs from library version 6.1.2.
warning: MPFR header version 3.1.4-p2 differs from library version 3.1.5.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: adb1813162fa70896e87bd1cd3f13704
COMPILER_PATH=/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.9.2/../../../avr/bin/
LIBRARY_PATH=/usr/lib/gcc/avr/4.9.2/avr25/tiny-stack/:/usr/lib/gcc/avr/4.9.2/../../../avr/lib/avr25/tiny-stack/:/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/4.9.2/../../../avr/lib/
COLLECT_GCC_OPTIONS='-iquote' '.' '-Os' '-pipe' '-g' '-v' '-c' '-o'
'blink.o' '-specs=device-specs/specs-attiny2313' '-mmcu=avr25' '-msp8'
2.$ avr-gcc blink.o -v -o blink.elf
Using built-in specs.
Reading specs from /usr/lib/gcc/avr/4.9.2/device-specs/specs-avr2
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.9.2/lto-wrapper
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++
--prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man
--bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib
--enable-shared --with-system-zlib --enable-long-long --enable-nls
--without-included-gettext --disable-libssp --build=i686-linux-gnu
--host=i686-linux-gnu --target=avr CFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' CPPFLAGS='-Wdate-time
-D_FORTIFY_SOURCE=2' CXXFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' FCFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' FFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' GCJFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong' LDFLAGS=-Wl,-z,relro OBJCFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat ' OBJCXXFLAGS='-g -O2
-fdebug-prefix-map=/build/gcc-avr-IRBaON/gcc-avr-4.9.2+Atmel3.5.3=.
-fstack-protector-strong -Wformat '
Thread model: single
gcc version 4.9.2 (GCC)
COMPILER_PATH=/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.9.2/../../../avr/bin/
LIBRARY_PATH=/usr/lib/gcc/avr/4.9.2/:/usr/lib/gcc/avr/4.9.2/../../../avr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'blink.elf' '-specs=device-specs/specs-avr2'
/usr/lib/gcc/avr/4.9.2/collect2 -plugin
/usr/lib/gcc/avr/4.9.2/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/avr/4.9.2/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccKYdDXH.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lm
-plugin-opt=-pass-through=-lc -o blink.elf -L/usr/lib/gcc/avr/4.9.2
-L/usr/lib/gcc/avr/4.9.2/../../../avr/lib blink.o --start-group -lgcc
-lm -lc --end-group
Did you build the compiler yourself?
No, this is a standard installation in Debian 9.7 (and the situation is
the same in modern ArchLinux)
Thank you for your reply. I hope to get something to understand.
_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev