Menu

#217 GNU-ARM -fstack-protector incompatible with the QP ports to GNU-ARM

QP
closed
None
1
2024-08-01
2018-06-22
No

Code compiled with GNU-ARM and the -fstack-protector-all option fails by corrupting the stack. The problem is in the GNU-ARM-specific port files (qk_port.c, qv_port.c and qxk_port.c), which produce corrupted stack when compiled with the option -fstack-protector-all.

The suggested solution is to add the attribute((optimize("-fno-stack-protector"))) specification to the "naked" functions in the port files (qk_port.c, qv_port.c and qxk_port.c):

__attribute__ ((naked, optimize("-fno-stack-protector")))
 void PendSV_Handler(void) {
     ~ ~ ~
 }

--MMS

Discussion

  • Quantum Leaps

    Quantum Leaps - 2018-06-30
    • status: open --> closed
     
  • Quantum Leaps

    Quantum Leaps - 2018-06-30

    Fixed in QP 6.3.3.
    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel