Improve fstack_protector effective target
commit8b25e69788383ea391541033582e3908b6084ecb
authorthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2017 21:48:35 +0000 (7 21:48 +0000)
committerthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2017 21:48:35 +0000 (7 21:48 +0000)
tree0911da3ce64cf83a36681782588324c347aff783
parent59d01fbaf41bf15a9737dc996ac44c24ac540f7b
Improve fstack_protector effective target

Effective target fstack_protector fails to return an error for
newlib-based target (such as arm-none-eabi targets) which does not
support stack protector. This is due to the test being too simplist for
stack protection code to be generated by GCC: it does not contain a
local buffer and does not read unknown input.

This commit adds a small local buffer with a copy of the filename to
trigger stack protector code to be generated. The filename is used
instead of the full path so as to ensure the size will fit in the local
buffer.

2017-12-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * lib/target-supports.exp (check_effective_target_fstack_protector):
    Copy filename in local buffer to trigger stack protection.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255484 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp