如何在profile中加入gcc优化参数?
我加在了最后,启动的时候提示命令没发现。该怎么加呀?谢谢!# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
unset pathmunge
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
CFLAGS=-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exception
export PATH PS1 HOSTNAME HISTSIZE HISTFILESIZE USER LOGNAME MAIL INPUTRC CFLAGS LANG LESSCHARSET CFLAGS='-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exception '
建议用O3,O3是公认的安全编译参数,效果也比O2好 部长的是什么?贴上来看看吧。
如果没记错的话我和你的cpu应该一样。我是图拉丁 赛扬 1.3G -O3 -march=pentium3 -mcpu=pentium3 -pipe -ffast-math -fomit-frame-pointer
我的是赛扬2 1G,赛扬2和赛扬3同属P3架构的CPU,用pentium3参数即可 我加入以下内容
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
export CHOST CFLAGS CXXFLAGS
登陆的时候不报错是不是就成功了?如果不是的话,那怎么知道自己加的参数成功了呢?
多谢! set命令,看输出信息有没有上述变量就知道正确没有
页:
[1]