WIZnet2012

W5300E01-ARM 交叉编译器(Cross Compiler)用户手册 (版本1.0)(三)

0
阅读(8302)

 

 

在上两篇博文里我们介绍了W5300E01-ARM 交叉编译器(Cross Compiler)用户手册的前半部分,包括第一章简介和第二章的源代码下载以及第三四五章,分别是LINUX内核安装,‘BINUTILS’安装和‘GCC’安装。

在这篇博文里我们将介绍第六章’glibc’安装。希望对大家有所帮助。

第一篇博文在这里:http://blog.chinaaet.com/detail/28785.html

第二篇博文在这里:http://blog.chinaaet.com/detail/28800.html

 

6.‘glibc’ 安装

6.1移动到工作目录并解压 ‘glibc’压缩包

cd /cross_tools/

tar jxvf glibc-2.3.3.tar.bz2

6.2在‘glibc’ 目录下解压‘linuxhreads’

tar –C glibc-2.3.3 –jxvf glibc-linuxthreads-2.3.3.tar.bz2

cd glibc-2.3.3

6.3修改‘Makeconfig’ 文件. (第514行)

修改前

 

 
 

gnulib := -lgcc –lgcc_eh

 

 

 

 

修改后

 

 
 

gnulib := -lgcc

 

 

 

 

 

6.4修改‘csu/Makefile’文件(第107行)

修改前

 

 
 

CFLAGS-initfini.s = -g0 –fPIC –fno-inline-functions

 

 

 

 

修改后

 

 
 

CFLAGS-initfini.s = -O1 –g0 –fPIC –fno-inline-functions

 

 

 

 

 

6.5修改‘linuxthreads/Makefile’ 文件(第104行)

修改前

 

 
 

CFLAGS-pt-initfini.s = -g0 –fPIC –fno-inline-functions

 

 

 

 

修改后

 

 
 

CFLAGS-pt-initfini.s = -O1 –g0 –fPIC –fno-inline-functions

 

 

 

 

 

6.6修改‘sysdeps/generic/framestate.c’文件. (第44行)

修改前

 

 
 

frame_state_for = fallback_frame_state_for;

 

 

 

 

 

修改后

 

 
 

#ifndef __USING_SJLJ_EXCEPTIONS__

frame_state_for = fallback_frame_state_for;

#else

frame_state_for = abort;

#endif

 

 

 

 

 

 

 

 

 

6.7修改‘sysdeps/arm/machine-gmon.h’文件. (第35 ~ 38行)

修改前

 

 
 

static void mcount_internal (u_long frompc, u_long selfpc);

 

#define _MCOUNT_DECL(frompc, selfpc) \

static void mcount_internal (u_long frompc, u_long selfpc)

 

 

 

 

 

 

 

修改后

 

 
 

#define _MCOUNT_DECL(frompc, selfpc) \

void mcount_internal (u_long frompc, u_long selfpc)

 

 

 

 

 

 

6.8修改‘sysdeps/unix/sysv/linux/arm/ioperm.c’文件(第98 ~ 104行)

修改前

 

 
 

static int

init_iosys (void)

{

char systype[256];

int I, n;

static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };

static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };

 

 

 

 

 

 

 

 

 

 

 

 

修改后

 

 
 

#include <linux/version.h>

static int

init_iosys (void)

{

char systype[256];

int I, n;

#if LINUX_VERSION_CODE < 132119

static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };

static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };

#else

static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };

static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };

#endif

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

创建一个目录对‘glibc’进行编译

mkdir build

cd build

6.9安装编译环境

CC=arm-linux-gcc ../configure –host=arm-linux –build=i686-pc-linux-gnu \

--prefix=/usr/local/arm/arm-linux –with-headers=/usr/src/linux/include \

--enable-add-ons=linuxthreads –enable-shared

6.10编译平台。如果你在编译‘csu/version-info.h’文件时发生错误,打开&修正这个文件并且重新编译。(第1~4行)

make

修改前

 

 
 

“Compiled on a Linux >>2.6.24-16-generic<< system on 2008-10-14

“Available extensions:

 

 

 

 

 

 

 

修改后

 

 
 

“Compiled on a Linux >>2.6.24-16-generic<< system on 2008-10-14“

“Available extensions:“

 

 

 

 

 

make

6.11安装编译的‘glibc’程序库.

Make install

6.12检查安装的‘glibc’ 程序库

ls /usr/local/arm/arm-linux/lib

 

 

如果您有任何疑问,请直接留言或登录WIZnet官方网站:http://www.wiznettechnology.cn/

或者来电:86-10-84539974(转166),QQ:2377211388,

邮箱:wiznetbj@wiznettechnology.com  联系人:Jerry ,谢谢!

公司微博是: http://weibo.com/wiznet2012

公司博客是:http://blog.csdn.net/WIZnet2012