[Lunar-commits] r19522 - moonbase/trunk/compilers/gcc4/plugin.d
Auke Kok
sofar at lunar-linux.org
Thu Mar 30 04:35:58 UTC 2006
Author: sofar
Date: 2006-03-30 04:35:57 +0000 (Thu, 30 Mar 2006)
New Revision: 19522
Modified:
moonbase/trunk/compilers/gcc4/plugin.d/optimize-gcc_4_0.plugin
Log:
sync with gcc3 plugin
Modified: moonbase/trunk/compilers/gcc4/plugin.d/optimize-gcc_4_0.plugin
===================================================================
--- moonbase/trunk/compilers/gcc4/plugin.d/optimize-gcc_4_0.plugin 2006-03-30 04:32:55 UTC (rev 19521)
+++ moonbase/trunk/compilers/gcc4/plugin.d/optimize-gcc_4_0.plugin 2006-03-30 04:35:57 UTC (rev 19522)
@@ -72,7 +72,7 @@
Blocks) c_cxx_flags_add "-freorder-blocks" ;;
esac
done
-
+
# STACK - kind of dangerous - shouldn't we just remove this?
if (( STACK > 0 )) ; then
c_cxx_flags_add "-mpreferred-stack-boundary=$STACK"
@@ -99,25 +99,21 @@
for OPT in ${CC_OPTS[@]}; do
case $OPT in
Deprecated)
- cflags_add "-Wno-deprecated"
- cppflags_add "-Wno-deprecated"
+ cxxflags_add "-Wno-deprecated"
;;
- ccpipe)
- COPT="$COPT -pipe"
+ Debug)
+ c_cxx_flags_add "-g"
;;
- cxxpipe)
- CCOPT="$CCOPT -pipe"
+ Pipe)
+ c_cxx_flags_add "-pipe"
;;
esac
done
- export COMPILER_PATH=/opt/lunar/gcc/4.0/bin
-
CC=gcc
CXX=g++
CPP=cpp
- export COPT CCOPT
export CFLAGS CXXFLAGS CPPFLAGS
export CC CXX CPP
@@ -251,6 +247,7 @@
SAFE_OPTIMIZATIONS=on
unset SPD XTRA STACK
FPM=("None")
+ BOPT=${BOPT//Fastest/Faster}
else
$DIALOG --defaultno --yes-label "No" --no-label "Yes" --colors --yesno " \Z1*** WARNING ***\n\n\ZnPlease read this carefully. You are about to turn off the optimization safety. This means that you can possibly turn on compiler or linker optimizations that can and will break your box. Not only will the problem most likely occur only days, weeks or months after you turn this switch, but also it can corrupt all your personal data, make your machine unbootable, and cause serious personal distress, headache, loss of vision, heart failure, loss of income, or otherwise very bad things. Before you turn off this option, please think for yourself for a minute and ask yourself: Is it worth it?\n\nOnly use safe optimizations?" 20 70
if [ $? == 0 ]; then
@@ -371,7 +368,7 @@
)
;;
esac
- menu radiolist "CPU, according to the kernel you have a$(cat /proc/cpuinfo | grep 'model name' | cut -d: -f2 | head -n 1)" &&
+ menu radiolist "CPU, according to the kernel you have a$(cat /proc/cpuinfo | grep 'model name' | cut -d: -f2 | head -n 1). If you are unsure, use $(arch) - anything higher is not safe." &&
CPU=$RESULT
;;
spd)
@@ -392,7 +389,7 @@
"Tracer" "-ftracer" $( echo ${SPD[@]} | grep -q "Tracer" && echo "on" || echo "off" ) "Perform tail duplication to enlarge superblock size."
"Blocks" "-freorder-blocks" $( echo ${SPD[@]} | grep -q "Blocks" && echo "on" || echo "off" ) "Reorder basic blocks in order to reduce number of taken branches."
)
- menu checklist "Select additional flags to optimize specific areas of the created code. Note that some of these flags are turned on automatically with -O2 or -O3. See 'man gcc' for more information" &&
+ menu checklist "Select additional flags to optimize specific areas of the created code. Note that some of these flags are turned on automatically with -O2 or -O3. See 'man gcc' for more information. None of these options are safe!" &&
SPD=($RESULT)
;;
fpm)
@@ -429,16 +426,15 @@
fi
;;
esac
- CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
+ unset FLAGS
for EXT in fpu sse altivec ; do
- if echo $CPUINFO | grep -q " $EXT "; then
+ if grep -qw "$EXT" /proc/cpuinfo ; then
FLAGS="$FLAGS $EXT"
fi
done
FLAGS=${FLAGS/fpu/387}
FLAGS=${FLAGS/387 sse/387 and sse (both)}
- unset CPUINFO EXT FLAGS
- menu radiolist "Select available Floating Point Math compile extensions. The kernel reports that this system has: $FLAGS" &&
+ menu radiolist "Select available Floating Point Math compile extensions. The kernel reports that this system has: $FLAGS. None of these are safe." &&
FPM=$RESULT
;;
xtra)
@@ -484,28 +480,28 @@
fi
;;
esac
- CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
- for EXT in mmx sse sse2 pni 3dnow altivec
- do
- if echo $CPUINFO | grep -q " $EXT "; then
+ unset FLAGS
+ for EXT in mmx sse sse2 pni 3dnow altivec ; do
+ if grep -qw "$EXT" /proc/cpuinfo ; then
+ echo $EXT
FLAGS="$FLAGS $EXT"
fi
done
- unset CPUINFO EXT FLAGS
- menu checklist "Select compiler use of extra instruction sets. The kernel reports that this system has: $FLAGS" &&
+ FLAGS=${FLAGS/pni/sse3}
+ menu checklist "Select compiler use of extra instruction sets. The kernel reports that this system has: $FLAGS. None of these are safe." &&
XTRA=($RESULT)
;;
cc_opt)
OPTIONS=(
- "Deprecated" "-Wno-deprecated for C++" $( echo ${CC_OPTS[@]} | grep -q "Deprecated" && echo "on" || echo "off" ) "Disable warnings of deprecated symbols in C++"
- "ccpipe" "-pipe for C (RECOMMENDED)" $( echo ${CC_OPTS[@]} | grep -q "ccpipe" && echo "on" || echo "off" ) "Enable cc to use named pipes."
- "cxxpipe" "-pipe for C++ (RECOMMENDED)" $( echo ${CC_OPTS[@]} | grep -q "cxxpipe" && echo "on" || echo "off" ) "Enable c++ to use named pipes."
+ "Deprecated" "-Wno-deprecated for C++" $( echo ${CC_OPTS[@]} | grep -qw "Deprecated" && echo "on" || echo "off" ) "Disable warnings of deprecated symbols in C++"
+ "Debug" "-g" $( echo ${CC_OPTS[@]} | grep -qw "Debug" && echo "on" || echo "off" ) "Add debug symbols"
+ "Pipe" "-pipe (RECOMMENDED)" $( echo ${CC_OPTS[@]} | grep -qw "Pipe" && echo "on" || echo "off" ) "Enable cc to use named pipes."
)
menu checklist "General C/C++ compiler settings" &&
CC_OPTS=($RESULT)
;;
stack)
- STACK=`$DIALOG --nocancel --inputbox "Enter the number to set the stack to, leave empty for default. Only used on x86 platform." 0 55 $STACK`
+ STACK=`$DIALOG --nocancel --inputbox "Enter the number to set the stack to, leave empty for default. Only used on x86 platform. Not safe" 0 55 $STACK`
;;
esac
done
More information about the Lunar-commits
mailing list