gcc8 error: pseudo instruction `__gcc_isr' not supported

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I put together gcc8.3.0 and associated tools (including avr-libc from SVN)  with the 1.3.300 AVR dev pack.  I'm trying to compile a program with interrupts and I get this:

$ make
/opt/local/bin/avr-gcc -DF_CPU=3333333 -mmcu=atmega4809 -Os -B/opt/local/avr/packs/1.3.300 -o main.elf main.c
/tmp/ccxANVF4.s: Assembler messages:
/tmp/ccxANVF4.s:12: Error: pseudo instruction `__gcc_isr' not supported
/tmp/ccxANVF4.s:22: Error: pseudo instruction `__gcc_isr' not supported
/tmp/ccxANVF4.s:24: Error: pseudo instruction `__gcc_isr' not supported
Makefile:19: recipe for target 'main.elf' failed
make: *** [main.elf] Error 1

Any ideas what this comes from or how to fix?

 

 

Here is fragment of the code:

#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/io.h>

volatile uint8_t flag;			/* signal interrupt */

ISR(PORTF_PORT_vect) {
  flag = 1;
  PORTF_INTFLAGS = PORT_INT6_bm;
}

int main(void) {

 

Here is the assembly generated w/ "gcc -S" ...

	.file	"main.c"
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__SREG__ = 0x3f
__CCP__ = 0x34
__tmp_reg__ = 0
__zero_reg__ = 1
	.text
.global	__vector_29
	.type	__vector_29, @function
__vector_29:
	__gcc_isr 1
/* prologue: Signal */
/* frame size = 0 */
/* stack size = 0...4 */
.L__stack_usage = 0 + __gcc_isr.n_pushed
	ldi r24,lo8(1)
	sts flag,r24
	ldi r24,lo8(64)
	sts 1193,r24
/* epilogue start */
	__gcc_isr 2
	reti
	__gcc_isr 0,r24
	.size	__vector_29, .-__vector_29
	.section	.text.startup,"ax",@progbits
.global	main
	.type	main, @function
main:

and the as command used by gcc during original compile

 /opt/local/lib/gcc/avr/8.3.0/../../../../avr/bin/as -mmcu=avrxmega3 -mno-skip-bug -o /tmp/ccAHVuhj.o /tmp/ccPmCxNm.s

 

This topic has a solution.
Last Edited: Sun. Sep 8, 2019 - 01:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

some refs:

PR21683

avr options in gcc manual  , near -mgas-isr-prologues-mgas-isr-prologues-mgas-isr-prologues

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like your binutils doesn't match your gcc

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks.   I don't think binutils is the issue.  I did check the versions, but will keep digging.  I may do the full rebuild of gcc, binutils, etc.

 

I did notice that if I compile with "-O0" (no optimization), the gcc_isr does not get created, so at least I have a workaround.

 

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found a fix: avr-gcc with argument "-Wa,-mgcc-isr".   I will be adding this to the device-specs files.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You already found the solution, but anyway I'll link to the original thread where this is discussed (German):

https://www.mikrocontroller.net/...

 

edit: I'm not sure, but I think recent updates of Atmel/Microchip device packs already include the fix.

edit #2: Never mind, you have 1.3.300 so it's not fixed. They should do it.

Last Edited: Sun. Sep 8, 2019 - 11:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
$ diff -c specs-atmega4809-old specs-atmega4809
*** specs-atmega4809-old	Sun Sep  8 06:42:13 2019
--- specs-atmega4809	Sun Sep  8 06:44:02 2019
***************
*** 96,101 ****
--- 96,106 ----
  *cpp:
  	-D__AVR_ATmega4809__ -D__AVR_DEVICE_NAME__=atmega4809 -D__AVR_DEV_LIB_NAME__=m4809
  
+ %rename asm old_asm
+ 
+ *asm:
+ 	%(old_asm) -mgcc-isr
+ 
  %rename link old_link
  
  *link:

^ device-specs/specs-atmega4809 update

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking at the specs that come w/ gcc or avr-libc, the correct specs directive seems to be

*asm_gccisr:
        %{!mno-gas-isr-prologues: -mgcc-isr}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi, you can find spec files for 0-series here:
.
https://www.mikrocontroller.net/topic/477852#5930557
.
The files have 3 additions: the asm_gccisr spec from above, definition of a symbol for the offset of flash mirror in LDS/LDD address range, and re-definition of a built-in macro for that offset.
.
FYI, the problem goes as follows:
.
avr-gcc v8+ issues a pseudo instruction in ISR prologues and epilogues to tweak ISRs. The worker is avr-as which resolves that pseudo instruction -- but only if it is supplied with option -mgcc-isr; otherwise as will complain. The option is set by avr-gcc which is agnostic wrt devices and just drags the options from a device specific specs file. To date, avr-gcc does not come with spec files for 0-series, hence spec files are from extern and adjusted by hand. If you use a specs written for avr-gcc v7, say, then the asm_gccisr spec is missing with the consequences explained above.
.
Note that you can use re-vamped spec files with older versions of avr-gcc; the asm_gccisr spec will be ignored and does no harm.

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks sprinter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pseudo ISR is now supported in Atmel.ATmega_DFP 1.4.331 and Atmel.ATtiny_DFP 1.4.283