https://github.com/torvalds/linux
Revision 6f0c0580b70c89094b3422ba81118c7b959c7556 authored by Linus Torvalds on 20 October 2012, 19:11:32 UTC, committed by Linus Torvalds on 20 October 2012, 19:11:32 UTC
1 parent 198190a
Raw File
Tip revision: 6f0c0580b70c89094b3422ba81118c7b959c7556 authored by Linus Torvalds on 20 October 2012, 19:11:32 UTC
Linux 3.7-rc2
Tip revision: 6f0c058
gcc-x86_64-has-stack-protector.sh
#!/bin/sh

echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
if [ "$?" -eq "0" ] ; then
	echo y
else
	echo n
fi
back to top