incompatible with avr-gcc7.1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Flashlight Firmware Repository |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Hello,
it seems like building fails on avr-gcc 7.1, it happens in an Arch VM and in Windows. Log:
[antergos-
CC STAR_smaller.o
avr-gcc -Wall -g -Os -mmcu=attiny13 -o STAR_smaller.o -c STAR_smaller.c
LD STAR_smaller.elf
avr-gcc -Wall -g -Os -mmcu=attiny13 -o STAR_smaller.elf STAR_smaller.o
STAR_smaller.o: In function `main':
/home/antergos-
STAR_smaller.o: In function `__vector_8':
/home/antergos-
/home/antergos-
/home/antergos-
/home/antergos-
collect2: error: ld returned 1 exit status
make: *** [Makefile:15: STAR_smaller.elf] Error 1
C:\Coding\
CC STAR_smaller.o
avr-gcc -Wall -g -Os -mmcu=attiny13 -o STAR_smaller.o -c STAR_smaller.c
LD STAR_smaller.elf
avr-gcc -Wall -g -Os -mmcu=attiny13 -o STAR_smaller.elf STAR_smaller.o
STAR_smaller.o: In function `main':
C:\Coding\
C:\Coding\
C:\Coding\
C:\Coding\
C:\Coding\
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:15: STAR_smaller.elf] Error 1
C:\Coding\
log for make -d: https:/
So, gcc 7.1 doesn't support the "inline" keyword by default? What happens if you add -std=gnu99 to the compile options?
The latest available in Debian (even in unstable) is gcc-avr 1:4.9.2+ Atmel3. 5.4-1. I'm not sure what all changed between gcc 4 and gcc 7, but some platforms failed by merely switching from 4 to 5. I expect to see a wide variety of problems for pretty much any project which uses gcc.
For this project, it looks like the inline functions may need to be declared as external, to trick the linker into not trying to resolve them. If -std=gnu99 doesn't work, what happens if you change those to "extern inline" instead of just "inline"?