linux-surface/kernel/scripts/gcc-x86_32-has-stack-protector.sh

10 lines
219 B
Bash
Raw Normal View History

2017-08-10 13:25:24 +00:00
#!/bin/sh
2017-11-06 02:38:20 +00:00
# SPDX-License-Identifier: GPL-2.0
2017-08-10 13:25:24 +00:00
echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
if [ "$?" -eq "0" ] ; then
echo y
else
echo n
fi