- 浏览: 452717 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
zjhgx:
多谢,多谢。多谢
Ubuntu 中软件的安装、卸载以及查看的方法总结 -
37du:
受教了,对于理解运行过程有很好的效果
ActionMapper---webwork 2.1到2.2 的变化 -
chxiaowu:
非常好,谢谢!
Ubuntu 中软件的安装、卸载以及查看的方法总结 -
euii:
谢谢,这样的总结。
Ubuntu 中软件的安装、卸载以及查看的方法总结 -
xiaoyao3857:
谢谢,正需要这样的汇总型字典!
Ubuntu 中软件的安装、卸载以及查看的方法总结
Friends,
After repeated attempts i was successful in building a gcc version 4.0
toolchain for ARM. I have documented the steps and am enclosing it below
for reference, if required by anybody. The patches to be applied to base
glibc are also attached alongwith.
Secondly, is there a web resource where i can upload the compiled
toolchain so that it can be downloaded and used by anybody, as per
his/her requirement.
Thanks
Vineet Tuli
***************************************************************************
Howto build toolchain for ARM using gcc 4.0
Note: The following compilation was done on Fedora Core 4 Linux.
Download the following files from their respective web sites:
binutils-2.16.tar.bz2 wget -c ftp://ftp.gnu.org/gnu/binutils/binutils-2.16.tar.bz2
gcc-4.0.2.tar.bz2 wget -c ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2
glibc-2.3.5.tar.gz wget -c ftp://ftp.gnu.org/gnu/glibc/glibc-2.3.5.tar.gz
glibc-linuxthreads-2.3.5.tar.gz wget -c ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.3.5.tar.gz
Place all the downloaded files inside the /usr/src directory of your system.
Create the Build Directories
[root at localhost
]# cd /usr/src
[root at localhost
]# mkdir build
[root at localhost
]# cd build
[root at localhost
]# mkdir binutils-2.16
[root at localhost
]# mkdir gcc-4.0.2
[root at localhost
]# mkdir glibc-2.3.5
Build binutils
[root at localhost
]# cd /usr/src
[root at localhost
]# tar –jxf binutils-2.16.tar.bz2
Chose
the prefix for the new tool chain. This is a directory where the tool
chain resides. This application report uses /opt/arm-v4 for the new
tool chain. The directory is created by the installation of the tools.
Go to the /usr/src/build/binutils-2.16 directory to configure and then
build the binary utilities with the commands shown below.
[root at localhost
]# cd /usr/src/build/binutils-2.16
[root at localhost
]# ../../binutils-2.16/configure –-target=arm-linux –-prefix=/opt/armv4
[root at localhost
]# make
[root at localhost
]# make install
The
new binary utilities can be found in /opt/armv4/bin. Add the path to
the binary utilities into your current path. If you are using the bash
shell,use the export command.
[root at localhost
]# export PATH=/opt/armv4/bin:$PATH
Kernel Headers
Download the kernel version from Kernel.org and the patch for the same from www.muru.com using the following:
wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.2.tar.bz2
wget -c http://www.muru.com/linux/omap/patches/patch-2.6.14-omap2.bz2
[root at localhost
]# cd /usr
[root at localhost
]# mkdir arm-linux
[root at localhost
]# cd arm-linux
Now, extract and patch the kernel using following commands:
[root at localhost
]# tar jxf linux-2.6.14.2.tar.bz2
[root at localhost
]# ln -s linux-2.6.14.2 linux
[root at localhost
]# bunzip2 patch-2.6.14-omap2.bz2
[root at localhost
]# cd linux
[root at localhost
]# patch -p1 < ../patch-2.6.14-omap2
[root at localhost
]# make omap_osk_5912_defconfig
Build gcc
The
gcc built here is just enough of the compiler without libraries so that
the kernel or the GNU C libraries can be built. Make sure that
/opt/armv4/bin is in the current path. To build gcc, the directories
/opt/armv4/arm-linux/include/asm and /opt/armv4/arm-linux/include/linux
must point to the corresponding kernel directories. Create the soft
link from the development tools to the Innovator linux kernel with the
following commands:
[root at localhost
]# cd /opt/arm-v4/arm-linux
[root at localhost
]# mkdir include
[root at localhost
]# cd include
[root at localhost
]# ln –s /usr/arm-linux/linux-2.6.14.2/include/asm-arm asm
[root at localhost
]# ln –s /usr/arm-linux//linux-2.6.14.2/include/linux linux
[root at localhost
]# cd /usr/src
[root at localhost
]# tar –xjf gcc-4.0.2.tar.bz2
A
configuration file must be modified so that the compiler is built
without libc includes. Edit the
/usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and append
–Dinhibit_libc –D__gthr_posix_h to the line starting with TARGET_LIBGCC2_CFLAGS =.
The top of the file is shown below, after appending the flags.
# Just for these, we omit the frame pointer since it makes such a big
# difference. It is then pointless adding debugging.
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC –Dinhibit_libc –D__gthr_posix_h
LIBGCC2_DEBUG_CFLAGS = -g0
Go to the /usr/src/build/gcc-4.0.2 directory to configure and build the GNU C compiler with the commands below.
[root at localhost
]# cd /usr/src/build/gcc-4.0.2
[root at localhost
]# ../../gcc-4.0.2/configure –-target=arm-linux –-prefix=/opt/armv4 --disable-threads –-enable-languages=c
[root at localhost
]# make
[root at localhost
]# make install
Build glibc
Before building glibc, invoke make in the kernel directory (to create linux/include/version.h required by glibc)
[root at localhost
]# cd /usr/arm-linux/linux-2.6.14.2
[root at localhost
]# make
Make sure /opt/armv4/bin is in the current path.
[root at localhost
]# cd /usr/src
[root at localhost
]# tar –xzf glibc-2.3.5.tar.gz
[root at localhost
]# cd glibc-2.3.5
[root at localhost
]# tar –xzf ../glibc-linuxthreads-2.3.5.tar.gz
Apply the attached patches (Details at the end of the document)
[root at localhost
]# cd /usr/src/build/glibc-2.3.5
[root at localhost
]# ../../glibc-2.3.5/configure arm-linux –-build=i686-pc-linux-gnu --prefix=/opt/armv4/arm-linux –-enable-add-ons=linuxthreads
[root at localhost
]# make
[root at localhost
]# make install
The new GNU C library can be found in /opt/armv4/arm-linux.
Build gcc With Additional Languages
Edit
the /usr/src/gcc-4.0.2/gcc/config/arm/t-linux file and remove the
append (Build gcc). Specifically, remove –Dinhibit_libc
–D__gthr_posix_h so that the top of the file appears as follows:
# Just for these, we omit the frame pointer since it makes such a big
# difference. It is then pointless adding debugging.
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
LIBGCC2_DEBUG_CFLAGS = -g0
[root at localhost
]# cd /usr/src/build/gcc-4.0.2
[root at localhost
]# rm –rf *
[root at localhost
]# ../../gcc-4.0.2/configure –-target=arm-linux –-prefix=/opt/armv4 –enable-languages=c,c++
[root at localhost
]# make
[root at localhost
]# make install
The complete set of GNU compilation tools can be found in /opt/armv4/bin.
Patches
The following files need to be patched to source code of glibc-2.3.5 for successful compilation of glibc:
(The required patches are attached)
1) glibc-2.3.5/include/libc-symbols.h
2) glibc-2.3.5/string/strcoll.c
3) glibc-2.3.5/include/wchar.h
4) glibc-2.3.5/wcsmbs/wcscoll.c
5) glibc-2.3.5/elf/dynamic-link.h
6) glibc-2.3.5/iconvdata/jis0208.h
7) glibc-2.3.5/sysdeps/unix/sysv/linux/arm/ioperm.c
8) glibc-2.3.5/sysdeps/arm/dl-machine.h
Note: If during compilation of glibc-2.3.5, following error occurs:
cannot find -lgcc_eh
Then
remove all the occurrences of -lgcc_eh from the files: Makeconfig,
configure and configure.in from the top level glibc source code
directory.
*************************************************************************************************************************
发表评论
-
Cache 的write back和write through
2010-04-22 15:47 2579Cache 的write back和write through ... -
选择 ARM处理器,ARM7还是Cortex-M3?
2010-04-08 00:52 2627要使用低成本的 32位处理器,开发人员面临两种选择,基于Cor ... -
16道嵌入式C语言面试题
2010-03-06 17:28 5478> 预处理器(Preprocessor) 1. 用预处 ... -
elf格式学习总结
2010-03-03 15:35 2060当编译一个源文件生成目标文件时,会在目标文件中生成符号表和重定 ... -
视频播放的基本原理
2010-03-03 10:08 5329VLC是一个功能强大的玩 ... -
Data Access Arrangement
2009-12-12 09:55 1050From Wikipedia, the free encycl ... -
系统启动挂载根文件系统时Kernel panic
2009-12-07 19:53 7257这类问题很常见,先总体介绍一下解决思路。 能出现让人激动 ... -
SPI and I2C
2009-12-03 15:29 1098SPI--Serial P ... -
LTIB - Linux Target Image Builder
2009-11-27 20:12 1359LTIB - Linux Target Image Build ... -
NAND
2009-11-21 14:52 1074NAND NAND闪存是一种比硬 ... -
MMC卡和SD卡的区别
2009-11-19 20:39 3503目前诸如MMC卡 和SD卡 ... -
Simple Embedded Linux System
2009-11-05 19:44 883Simple Embedded Linux System ... -
Building a root filesystem
2009-11-05 19:25 1082Building a root filesystem ... -
Solution to kill "version `GLIBC_2.*' not found error"
2009-10-31 14:40 11081. Make ubuntu compile using an ... -
Linux 共享库:尽量避免 LD_LIBRARY_PATH
2009-10-31 12:40 1638Linux 运行的时候,是如何管理共享库(*.so)的? ... -
nfs配置
2009-10-30 21:06 11391.安装nfs服务器端和客户端 服务器端:sudo apt- ... -
如何为嵌入式开发建立交叉编译环境
2009-10-21 20:05 1113http://www.ibm.com/developerwor ... -
Architecture and TAEGET 对照表
2009-10-21 19:38 1081也可见附件 -
Linux for PowerPC Embedded Systems HOWTO
2009-10-21 19:24 2210Table of Contents : ...
相关推荐
GNU Assembler for ARM(通常简称为as)是针对ARM架构的工具链,包括编译器、调试器和其他相关的开发工具,这些工具为ARM嵌入式开发人员提供了全面的开发环境。 GNU Assembler for ARM的特点包括对多种ARM处理器...
arm-gnu-toolchain-4.8.4.371-linux.any.x86_64.tar.gz 在CENTOS 6.5 64 下测试 ATMEL ST M3 M4 都OK,生成BIN要比KEIL大点
GNU链接器(GNU ld)是GNU工具集的一部分,专门用于处理程序的链接过程,它支持ARM嵌入式处理器。链接器是编译过程中不可或缺的一步,它将编译后的代码(通常是目标文件)以及所需的库文件合并成一个单一的可执行...
The GNU Embedded Toolchain for Arm is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU ...
The GNU Embedded Toolchain for Arm is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU ...
### ARM Cortex GNU Toolchain #### 1. 引言 本文档主要介绍如何在基于ARM Cortex-M3的STM32微控制器上使用GNU工具链来部署QP/C™ 和 QP™/C++状态机框架。该开发包(QDK)以STMicroelectronics的SAM3210C-EVAL...
The GNU Embedded Toolchain for Arm is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU ...
文档末尾部分会包括许可证信息,即GNU通用公共许可证(GPL)和GNU自由文档许可证(GFDL),这两个许可证对GCC for ARM的使用、分发和修改提供了法律指导。 综上所述,GCC for ARM手册是一份针对开发ARM平台程序的...
The GNU Embedded Toolchain for Arm is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU ...
A summary of useful commands and expressions for the ARM architecture using the GNU assembler is presented briefly in the concluding portion of this Appendix. GNU Assembler Directives for ARM The ...
在嵌入式开发领域,GNU ARM Eclipse 是一个非常重要的开源项目,它为开发者提供了一整套集成开发环境(IDE)的扩展,专为基于 ARM 架构的微控制器进行 C/C++ 开发。这个项目是建立在 Eclipse 平台之上,充分利用了 ...
GNU make is the most widely used build automation tool, but it can be challenging to master and its terse language can be tough to parse for even experienced programmers. Those who run into ...
riscv-gnu-toolchain, RISC V的GNU工具链,包括 GCC risc-v-编译器工具链 这是 risc v C 和 C 交叉编译器。 它支持两种生成模式: 通用 elf/newlib工具链和更高级的linux elf/glibc工具链。获取源这个库使用子模块。...
标题《How_To_Port_GNU_ToolChain》和描述《介绍GCC port的基本步骤,介绍前后端相关知识》暗示了本文所涉及的内容是关于如何移植GNU编译器工具链(GNU Toolchain),特别是GCC(GNU Compiler Collection)的相关...
avr8-gnu-toolchain-installer avr 编译安装环境
AVR8 GNU Toolchain是为Atmel AVR 8位微控制器设计的一套开发工具链,由GNU项目提供,主要用于编写、编译、链接和调试基于AVR微控制器的应用程序。这个压缩包“avr8-gnu-toolchain-3.6.2.1778-win32.any.x86.zip”...
GNU Embedded Toolchain for Arm是一个即用型开源工具套件,适用于针对Arm Cortex-M和Cortex-R系列处理器的C,C ++和汇编编程。它包括GNU编译(GCC),可直接从Arm免费获得,用于Windows,Linux和Mac OS X操作系统上...
arm-2011.03-46-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2 arm-2011.03-46-arm-uclinuxeabi.bin arm-2011.03-46-arm-uclinuxeabi.exe arm-2011.03-46-arm-uclinuxeabi.src.tar.bz2 arm-2012.03-42-arm-none-...
适用于Windows的GNU工具链 该存储库是二进制文件的集合,用于创建您自己的Windows中可用的GNU工具链。 master分支的主干包含所有二进制文件的最新版本的总和。 提供了以下程序的二进制文件: 海湾合作委员会7 ...