Skip to content
Snippets Groups Projects
  • Tejun Heo's avatar
    stackprotector: update make rules · 5d707e9c
    Tejun Heo authored
    
    Impact: no default -fno-stack-protector if stackp is enabled, cleanup
    
    Stackprotector make rules had the following problems.
    
    * cc support test and warning are scattered across makefile and
      kernel/panic.c.
    
    * -fno-stack-protector was always added regardless of configuration.
    
    Update such that cc support test and warning are contained in makefile
    and -fno-stack-protector is added iff stackp is turned off.  While at
    it, prepare for 32bit support.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    5d707e9c
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
gcc-x86_64-has-stack-protector.sh 199 B
#!/bin/sh

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"
if [ "$?" -eq "0" ] ; then
	echo y
else
	echo n
fi