https://github.com/torvalds/linux
Raw File
Tip revision: b04e217704b7f879c6b91222b066983a44a7a09f authored by Linus Torvalds on 27 May 2018, 20:01:47 UTC
Linux 4.17-rc7
Tip revision: b04e217
gcc-x86_64-has-stack-protector.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

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