搭建mips toolchain
来源:互联网 发布:穆雅斓的淘宝店改名了 编辑:程序博客网 时间:2024/06/08 06:13
1、下载binutils-2.15,gcc-3.2.2,glibc-2.3.2,glibc-linuxthreads-2.3.2,linux-2.4.18
2、配置编译binutils
./configure --refix=/opt/mips-toolchain --target=mipsel-linux
make
make install
3、配置编译自举gcc
./configure --prefix=/opt/mips-toolchain --target=mipsel-linux --enable-languages=c --without-headers --with-newlib --disable-shared --disable-threads
make
make install
此处有两个选项需要注意,--wiht-newlib指定gcc不要寻找glibc的头文件,--disable-threads指定gcc不需要pthread的头文件,否则在编译时会自这两处报错,都是找不到对应的头文件
自举gcc安装成功后就可以编译kernel和bootloader了
4、配置内核
进入内核源代码目录,对内核进行配置,目的是产生正确的asm的链接和version.h头文件,然后将linux-2.4.18/include/中的asm和linux目录整个拷贝到/opt/mips-toolchain/include目录下面
5、配置编译glibc
建立glibc-mips目录
在glibc-2.3.2和glibc-mips目录下面分别解压缩glibc-linuxthreads-2.3.2.tar.gz
glibc-2.3.2需要elf-machine-rela-mips-dpatch补丁,网上有些网友说还需要sscanf的补丁,但是我没用到
../glibc-2.3.2/configure --host=mipsel-linux --enable-add-ons=linuxthreads
make
make install_root=/opt/mips-glibc install
install_root指定了glibc的安装目录
将/opt/mips-glibc/usr/local中的lib和include目录拷贝到/opt/mips-toolchain/mipsel-linux中,并将lib目录中的文件拷贝到/usr/local/lib中,为编译完整的gcc做准备
6、配置编译完整的gcc
./configure --prefix=/opt/mips-toolchain --target=mipsel-linux --enable-shared --enable-threads --with-headers=/opt/mips-toolchain/mipsel-linux/include
make
make install
到这里完整的mips toolchain就搭建完成了
2、配置编译binutils
./configure --refix=/opt/mips-toolchain --target=mipsel-linux
make
make install
3、配置编译自举gcc
./configure --prefix=/opt/mips-toolchain --target=mipsel-linux --enable-languages=c --without-headers --with-newlib --disable-shared --disable-threads
make
make install
此处有两个选项需要注意,--wiht-newlib指定gcc不要寻找glibc的头文件,--disable-threads指定gcc不需要pthread的头文件,否则在编译时会自这两处报错,都是找不到对应的头文件
自举gcc安装成功后就可以编译kernel和bootloader了
4、配置内核
进入内核源代码目录,对内核进行配置,目的是产生正确的asm的链接和version.h头文件,然后将linux-2.4.18/include/中的asm和linux目录整个拷贝到/opt/mips-toolchain/include目录下面
5、配置编译glibc
建立glibc-mips目录
在glibc-2.3.2和glibc-mips目录下面分别解压缩glibc-linuxthreads-2.3.2.tar.gz
glibc-2.3.2需要elf-machine-rela-mips-dpatch补丁,网上有些网友说还需要sscanf的补丁,但是我没用到
../glibc-2.3.2/configure --host=mipsel-linux --enable-add-ons=linuxthreads
make
make install_root=/opt/mips-glibc install
install_root指定了glibc的安装目录
将/opt/mips-glibc/usr/local中的lib和include目录拷贝到/opt/mips-toolchain/mipsel-linux中,并将lib目录中的文件拷贝到/usr/local/lib中,为编译完整的gcc做准备
6、配置编译完整的gcc
./configure --prefix=/opt/mips-toolchain --target=mipsel-linux --enable-shared --enable-threads --with-headers=/opt/mips-toolchain/mipsel-linux/include
make
make install
到这里完整的mips toolchain就搭建完成了
0 0
- 搭建mips toolchain
- Setup MIPS cross compile toolchain
- Android Toolchain环境搭建
- 搭建mips学习环境
- toolchain
- ToolChain
- 博通“toolchain”搭建——准备篇!
- OpenWrt编译出ARM/MIPS等平台的native GCC (toolchain)
- 基于MIPS的uBoot编译环境搭建
- 基于MIPS的uBoot编译环境搭建
- Ubuntu下搭建MIPS交叉编译环境
- Ubuntu下搭建MIPS交叉编译环境
- Ubuntu下搭建MIPS交叉编译环境
- M5-mips交叉编译环境搭建
- Ubuntu下搭建MIPS交叉编译环境
- MIPS
- MIPS
- MIPS
- Android 下拉刷新 上拉加载更多框架实现
- LoadRunner录制脚本时出现:Unable to connect to remote server),有事件没有脚本的问题
- 并查集小记
- 大数据计算新贵Spark在腾讯雅虎优酷成功应用解析
- Swift
- 搭建mips toolchain
- vivi分析-顶层Makefile
- cmd命令运行TOMCAT部署的网站
- UVa10048 Audiophobia
- JTabbedPane的选项卡自定义位置
- ffmpeg常见命令
- JROO JDBC,一个ORM急速开发框架
- UVA 1030 Image Is Everything
- SSDT HOOK,通过hook NtOpenProcess达到保护制定进程效果