Question about gcc options '-mapcs-stack-check' and '-mapcs-frame'

Akhilesh chirlancha akhileshchirlancha@gmail.com
Fri Aug 24 13:41:00 GMT 2018


Hello All,

I'm using gcc 5.4.0 for armhf target.

I was compiling simple stack over flow test code with '-mapcs-stack-check'
option.
# gcc -mapcs-stack-check test.c
test.c:1:0: warning: -mapcs-stack-check incompatible with -mno-apcs-frame
 #include<stdio.h>
 ^

As per my understanding from the above warning is -mapcs-stack-check option
depends on -mapcs-frame. Is my understanding correct?? If yes, gcc should
work for -mapcs-frame.
But I found this in GCC online docs(
https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc.pdf)
-mapcs-frame
        Generate a stack frame that is compliant with the ARM Procedure
Call Standard for all functions, even if this is not strictly necessary for
correct execution of the code. Specifying '-fomit-frame-pointer' with this
option causes the stack frames not to be generated for leaf functions. The
default is '-mno-apcs-frame'. This option is deprecated.

Document saying '-mapcs-frame' option is deprecated. Does it mean I can't
use -mapcs-stack-check option?

Thanks in advance,

Best Regards
-Akhilesh



More information about the Gcc-help mailing list