A less than great workaround might be to mark the IRQ handler as
Code: Select all
If you aren't familiar with the attribute, it is mentioned here: https://gcc.gnu.org/onlinedocs/gcc/ARM- ... Attributes
Strictly speaking you can only rely on plain asm statements inside a naked function, so to be on the safe side you would need to declare a separate function that *isn't* naked and move the current function body there - excluding the lr save/restore macros. You can then use inline assembly in the naked function to call your new/real IRQ handler.
If it works it's not the worst hack in the world, and it's better than #error with a bugged compiler version.