分类: LINUX
2008-04-11 10:39:28
此步骤不需要设置内核头文件!
进入build-tools目录, 下载
并到网站下载这三个补丁:
解压GCC,并打补丁: $cd gcc-2.95.3
$patch -p1< ../gcc-patch/gcc-2.95.3-2.patch
$patch -p1< ../gcc-patch/gcc-2.95.3-no_fixinc-1.patch
$patch -p1< ../gcc-patch/gcc-2.95.3-returntype_fix-1.patch
echo timestamp > gcc/cstamp-h.in
如果你用的是Ubuntu默认的gcc(既安装build-essential中的gcc, 该gcc的版本目前是4.0.2). 在编译时候会提示"invalid lvalue in increment"错误. 最好使用gcc-3.3. Ubuntu中安装gcc-3.3: $ sudo apt-get install gcc-3.3 只有调用不同版本的gcc, 只需: $ export CC=gcc-3.3 |
实际上, 应该这样修改t-linux: 在TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC语句之前添加"T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h" 成为: T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC |
../../gcc-2.95.3/gcc/gthr-posix.h:37: pthread.h: No such file or directory
可能是去掉posix thread支持吧.如果用的比较老版本gcc (比如gcc-2.95.3) 在配置过程中会提示这样的错误: Config.guess failed to determine the host type. You need to specify one. 这是由于config.guess, config.sub版本太老. config.guess是用来检测host类型的, 运行它就能得知host类型. 解决方法: 到ftp://ftp.gnu.org/pub/pub/gnu/config/下载新版的config.guess和config.sub: *checkout*/config/config/config.guess |
chinaunix网友2009-03-11 11:50:31
libgcc1.S:438: asm/unistd.h: ?????????
make[1]: *** [libgcc1-asm.a] Error 1
make: *** [all-gcc] Error 2
将目标文件夹$TARGET_PREFIX/include/内的asm-linux文件夹更改名称为asm,
因为配置文件的include包含都是
chinaunix网友2008-12-23 18:52:42
你好,我现在也在学嵌入式系统,也在安装交叉编译工具,同样的在编译gcc这一步时出现错误,也按照你的方法修改了t-linux,可还是有如下错误: libgcc1.S: Assembler messages: libgcc1.S:75: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:76: Warning: ignoring redefinition of register alias 'sp' libgcc1.S:77: Warning: ignoring redefinition of register alias 'lr' libgcc1.S:78: Warning: ignoring redefinition of register alias 'pc' libgcc1.S: Assembler messages: libgcc1.S:243: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:244: Wa
chinaunix网友2008-12-23 18:52:39
你好,我现在也在学嵌入式系统,也在安装交叉编译工具,同样的在编译gcc这一步时出现错误,也按照你的方法修改了t-linux,可还是有如下错误: libgcc1.S: Assembler messages: libgcc1.S:75: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:76: Warning: ignoring redefinition of register alias 'sp' libgcc1.S:77: Warning: ignoring redefinition of register alias 'lr' libgcc1.S:78: Warning: ignoring redefinition of register alias 'pc' libgcc1.S: Assembler messages: libgcc1.S:243: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:244: Wa
chinaunix网友2008-12-23 18:52:32
你好,我现在也在学嵌入式系统,也在安装交叉编译工具,同样的在编译gcc这一步时出现错误,也按照你的方法修改了t-linux,可还是有如下错误: libgcc1.S: Assembler messages: libgcc1.S:75: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:76: Warning: ignoring redefinition of register alias 'sp' libgcc1.S:77: Warning: ignoring redefinition of register alias 'lr' libgcc1.S:78: Warning: ignoring redefinition of register alias 'pc' libgcc1.S: Assembler messages: libgcc1.S:243: Warning: ignoring redefinition of register alias 'ip' libgcc1.S:244: Wa