https://github.com/torvalds/linux
Raw File
Tip revision: 5d01410fe4d92081f349b013a2e7a95429e4f2c9 authored by Linus Torvalds on 23 November 2014, 23:25:20 UTC
Linux 3.18-rc6
Tip revision: 5d01410
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