lmbench3 完整移植
首先,下载一份源代码:http://www.bitmover.com/lmbench/get_lmbench.html然后解压。export PATH=$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/修改scripts/os,sc
首先,下载一份源代码:http://www.bitmover.com/lmbench/get_lmbench.html
然后解压。
export PATH=$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/
修改scripts/os,scripts/compiler属性:
chmod 777 scripts/os
chmod 777 scripts/compiler
chmod 777 scripts/build
chmod 777 src/Makefile
然后os修改内容:
#!/bin/sh
OS=arm-none-linux-gnueabi
if [ "X$OS" != "X" ] && echo "$OS" | grep -q '`'
then
OS=
fi
if [ "X$OS" = "X" ]
then OS=bloat-os
MACHINE=`uname -m | sed -e 's/ //g' | sed -e 's?/?-?g'`
SYSTEM=`uname -s | sed -e 's/ //g' | sed -e 's?/?-?g'`
OS="${MACHINE}-${SYSTEM}"
if [ -f ../scripts/gnu-os ]
then OS=`../scripts/gnu-os | sed s/unknown-//`
fi
if [ -f ../../scripts/gnu-os ]
then OS=`../../scripts/gnu-os | sed s/unknown-//`
fi
fi
echo $OS
再次修改compiler:
#!/bin/sh
CC=arm-none-linux-gnueabi-gcc
if [ "X$CC" != "X" ] && echo "$CC" | grep -q '`'
then
CC=
fi
if [ X$CC = X ]
then CC=cc
for p in `echo $PATH | sed 's/:/ /g'`
do if [ -f $p/gcc ]
then CC=gcc
fi
done
fi
echo $CC
修改build,静态编译:
LDLIBS=" -static -lm "
修改src/Makefile,删掉bk.ver:
$O/lmbench : ../scripts/lmbench bk.ver
rm -f $O/lmbench
sed -e "s/<version>/`cat bk.ver`/g" < ../scripts/lmbench > $O/lmbench
chmod +x $O/lmbench
OK,make.!!! 搞掂。
编译出来的文件在bin/bin/arm-none-linux-gnueabi
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)