This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about gcc options '-mapcs-stack-check' and '-mapcs-frame'
- From: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- To: Akhilesh chirlancha <akhileshchirlancha at gmail dot com>, gcc-help at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Mon, 3 Sep 2018 17:46:31 +0100
- Subject: Re: Question about gcc options '-mapcs-stack-check' and '-mapcs-frame'
- References: <CAFBMa4wQSsP0TRjVLqNhV0KHw1EQxDoM6DzN42m_bFm+BsqJ1w@mail.gmail.com>
On 24/08/18 14:51, Akhilesh chirlancha wrote:
> 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?
>
It wouldn't help even if you did. I don't think APSC-style stack
checking was ever fully implemented in GCC.
R.
> Thanks in advance,
>
> Best Regards
> -Akhilesh
>