2012年7月13日星期五

W5300E01-ARM 交叉編譯器(Cross Compiler)用戶手冊 (版本1.0)(三)


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


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


或者来电:86-10-84539974(转166),QQ:2377211388,
邮箱:wiznetbj@wiznettechnology.com  联系人:Jerry ,谢谢!
公司微博是: http://weibo.com/wiznet2012

没有评论:

发表评论