https://github.com/torvalds/linux
Raw File
Tip revision: 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c authored by Linus Torvalds on 02 July 2017, 23:07:02 UTC
Linux 4.12
Tip revision: 6f7da29
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 -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
if [ "$?" -eq "0" ] ; then
	echo y
else
	echo n
fi
back to top