[LinuxBIOS] Fwd: Possible stack protect solutions (RESEND)

Peter Stuge peter at stuge.se
Sun Jan 6 03:14:40 CET 2008


On Thu, Jan 03, 2008 at 09:30:06AM -0800, ron minnich wrote:
> Add the ability to extend CFLAGS as needed for several new distros
> Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>

Acked-by: Peter Stuge <peter at stuge.se>

> Index: targets/buildtarget
> ===================================================================
> --- targets/buildtarget	(revision 3031)
> +++ targets/buildtarget	(working copy)
> @@ -53,4 +53,25 @@
>  export PYTHONPATH=$config_dir
>  $PYTHON $config_py $config_lb $lbpath
>  
> +# now start checking for distro-specific breakage. 
> +## This check is for the no stack protector mess.
> +EXTRA_CFLAGS=
> +
> +if [ -z "$CC" ]; then
> +       CC=gcc
> +fi
> +
> +$CC -fno-stack-protector -S -xc /dev/null -o .$$.tmp
> +
> +if [ $? -eq 0 ]; then
> +       EXTRA_CFLAGS=-fno-stack-protector
> +fi
> +
> +rm -rf .$$.tmp
> +
> +for i in $build_dir/Makefile.settings $build_dir/*/Makefile.settings
> +do
> +	echo CFLAGS+=$EXTRA_CFLAGS >>$i
> +done
> +
>  exit $?




More information about the coreboot mailing list