制作mipsel 交叉工具链 (更新版)
2014-01-26 04:05
148 查看
1. 代码结构为:
setup ---> 源代码压缩包
build --> 编译目录
kernel ----> 内核代码:
2.编译 binutils
在build/binutils 下,执行命令:
3. 编译 GCC stage 1
在 build/gcc目录下,执行
make all-gcc all-target-libgcc
make install-gcc install-target-libgcc
4. 安装内核头文件
进入到内核代码目录,
执行命令:
5. 编译 GLIBC
进入到 build/glibc,执行
再执行
最后,看一下生成的gcc的信息:
参考:
http://toolchain-arm.blogspot.jp/2012/06/building-eglibc.html
setup ---> 源代码压缩包
:~/code/cross-compile$ ls setup/ binutils-2.24.tar.bz2 gcc-4.7.1.tar.bz2 gdb-7.6.2.tar.bz2 glibc-2.18.tar.bz2 linux-3.10.tar.bz2 gcc-4.6.4.tar.bz2 gcc-4.8.0.tar.bz2 glibc-2.17.tar.bz2 glibc-linuxthreads-2.5.tar.bz2 termcap-1.3.1.tar.gzsrc --->源码
~/code/cross-compile$ ls src/ binutils-2.24 gcc-4.7.1 gdb-7.6.2 glibc-2.18
build --> 编译目录
:~/code/cross-compile$ ls build/ binutils gcc gdb glibc
kernel ----> 内核代码:
~/code/cross-compile/kernel$ ls linux-3.10
2.编译 binutils
在build/binutils 下,执行命令:
../../src/binutils-2.24/configure --target=mipsel-linux-gnueabi --prefix=/home/charles/code/cross-compile/embedded-toolchain/cross-tools --with-sysroot=/home/charles/code/cross-compile/embedded-toolchain然后,执行 make, make install 安装
3. 编译 GCC stage 1
在 build/gcc目录下,执行
AR=ar LDFLAGS="-Wl,-rpath=/home/charles/code/cross-compile/embedded-toolchain/cross-tools/lib" ../../src/gcc-4.7.1/configure --prefix=/home/charles/code/cross-compile/embedded-toolchain/cross-tools --target=mipsel-linux-gnueabi --with-sysroot=/home/charles/code/cross-compile/embedded-toolchain --with-gmp=/usr/local --with-mpfr=/usr/local --with-ppl=/usr/local --with-newlib --without-headers --disable-multilib --disable-nls --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-shared --disable-threads --enable-languages=c --with-float=soft --with-arch=mips32r2 --with-tune=mips32r2然后,
make all-gcc all-target-libgcc
make install-gcc install-target-libgcc
4. 安装内核头文件
进入到内核代码目录,
执行命令:
ARCH=mips make mrproper ARCH=mips make headers_check ARCH=mips CROSS_COMPILE=mipsel-gcc-linux-gnueabi make INSTALL_HDR_PATH=/home/charles/code/cross-compile/embedded-toolchain/usr headers_install find /home/charles/code/cross-compile/embedded-toolchain/usr/include/ -name ".install" -or -name "..install.cmd" | xargs rm -fv ;\
5. 编译 GLIBC
进入到 build/glibc,执行
BUILD_CC=gcc CC=mipsel-linux-gnueabi-gcc AR=mipsel-linux-gnueabi-ar RANLIB=mipsel-linux-gnueabi-ranlib ../../src/glibc-2.18/configure --prefix=/usr --host=mipsel-linux --enable-add-ons --with-fp=no libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes libc_cv_ctors_header=yes --with-tune=mips32r2 --with-arch=mips32r2 --with-headers=/home/charles/code/cross-compile/embedded-toolchain/usr/include把步骤3生成的mipsel gcc 加入到 path:
export PATH=$PATH:/home/charles/code/cross-compile/embedded-toolchain/cross-tools/bin执行
make make install install_root=/home/charles/code/cross-compile/embedded-toolchain6.编译最后的GCC
AR=ar LDFLAGS="-Wl,-rpath=/home/charles/code/cross-compile/embedded-toolchain/cross-tools/lib" ../../src/gcc-4.7.1/configure --prefix=/home/charles/code/cross-compile/embedded-toolchain/cross-tools --target=mipsel-linux-gnueabi --with-sysroot=/home/charles/code/cross-compile/embedded-toolchain --with-gmp=/usr/local --with-mpfr=/usr/local --with-ppl=/usr/local --disable-multilib --disable-libssp --disable-nls --disable-libstdcxx-pch --with-arch=mips32r2 --with-tune=mips32r2 --enable-languages=c,c++ --with-float=soft --with-mips-plt --disable-libgomp --disable-libmudflap --enable-poison-system-directories --enable-symvers=gnu --enable-long-long --enable-threads --enable-shared --enable-lto --enable-__cxa_atexit --with-gnu-as --with-gnu-ld
再执行
make all-gcc -j10 -i -k make all-target-libgcc make install-gcc make install-target-libgcc make make install
最后,看一下生成的gcc的信息:
./mipsel-linux-gnueabi-gcc -v Using built-in specs. COLLECT_GCC=./mipsel-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/home/charles/toolchain/embedded-toolchain/cross-tools/bin/../libexec/gcc/mipsel-linux-gnueabi/4.7.1/lto-wrapper Target: mipsel-linux-gnueabi Configured with: ../../src/gcc-4.7.1/configure --prefix=/home/charles/code/cross-compile/embedded-toolchain/cross-tools --target=mipsel-linux-gnueabi --with-sysroot=/home/charles/code/cross-compile/embedded-toolchain --with-gmp=/usr/local --with-mpfr=/usr/local --with-ppl=/usr/local --disable-multilib --disable-libssp --disable-nls --disable-libstdcxx-pch --with-float=soft --with-arch=mips32r2 --with-tune=mips32r2 --enable-languages=c,c++ --with-float=soft --with-mips-plt --disable-libgomp --disable-libmudflap --enable-poison-system-directories --enable-symvers=gnu --enable-long-long --enable-threads --enable-shared --enable-lto --enable-__cxa_atexit --with-gnu-as --with-gnu-ld Thread model: posix gcc version 4.7.1 (GCC)
参考:
http://toolchain-arm.blogspot.jp/2012/06/building-eglibc.html
相关文章推荐
- 制作mipsel 交叉工具链
- 制作mipsel 交叉工具链
- 制作mipsel 交叉工具链
- 制作交叉工具链(龙芯)
- crosstool-ng 制作arm交叉工具链心得
- 使用OE制作arm-linux交叉工具链
- c#自动更新+安装程序的制作
- 基于51最小系统的距离测量仪制作/更新于2017/12/30
- py3+tensorflow+opencv基于深度学习制作人脸识别系统学习历程(持续更新)
- c#自动更新+安装程序的制作
- JAVA安装包制作神器install4j 版本更新至v6.1.5,密码字段选项添加新属性|附下载
- moss点滴记录:自己动手制作moss 2007 sp1,基础更新,sp2安装包
- 交叉工具链制作至尊宝典
- 使用ZedGraph制作动态更新的统计图
- 对XML Feed制作与更新流程研究报告
- 制作64位安装包及制作更新包
- .Net部署二三事之一——如何为VS安装文件MSI制作更新补丁MSP
- 使用ZedGraph制作动态更新的统计图
- 易饭原创:小易U盘安装ghost版xp完美解决方案(解决启动U盘制作难题)09.2.27更新
- windows 10专业版14393.447 64位纯净无广告版系统 基于官方稳定版1607制作 更新于20161112