This patch will enable setting distro variables such as -fno_stack_protector as needed. It is a simple patch to buildtarget and can be extended for other uses.
If this patch is acceptable then we can fix the various makefiles to include the variable. The only remaining question is the name -- is CPU_OPT really appropriate? Signed-off-by: Ronald G. Minnich <[EMAIL PROTECTED]> ---------- Forwarded message ---------- From: ron minnich <[EMAIL PROTECTED]> Date: Dec 20, 2007 11:24 AM Subject: Re: [LinuxBIOS] Possible stack protect solutions To: Jordan Crouse <[EMAIL PROTECTED]> Cc: linuxbios@linuxbios.org Try this. This patch to buildtarget 1. sets up cpu opt for the no stack protector thing 2. sets up the makefiles for the target 3. the target builds But it's not picking up CPU_OPT. So we MUST have the other patch that ALWAYS includes CPU_OPT. That said, I'd rather make the variable DISTRO_CC_OPT or some such. Thanks ron
Index: buildtarget =================================================================== --- buildtarget (revision 3012) +++ 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. +CPU_OPT= + +if [ -z "$CC" ]; then + CC=gcc +fi + +$CC -fno-stack-protector -S -xc /dev/null -o .$$.tmp + +if [ $? -eq 0 ]; then + CPU_OPT=-fno-stack-protector +fi + +rm -rf .$$.tmp + +for i in $build_dir/Makefile.settings $build_dir/*/Makefile.settings +do + echo CPU_OPT=$CPU_OPT >>$i +done + exit $?
-- linuxbios mailing list linuxbios@linuxbios.org http://www.linuxbios.org/mailman/listinfo/linuxbios