gcc-x86_64-has-stack-protector.sh 187 B

123456
  1. #!/bin/sh
  2. echo "int foo(void) { char X[200]; return 3; }" | $1 -S -xc -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
  3. if [ "$?" -eq "0" ] ; then
  4. echo $2
  5. fi