LFS系列
时间:2009-08-24 来源:chinahhucai
编译LFS过程中遇到的错误以及解决的方法
在编译安装过程中,一定要选好编译环境,如果你要进行LFS6.3以下的,那么不推荐使用高于或者是等于4.2版本的gcc,4.1最好。如果你要进行的LFS6.4,那么不应该使用4.3.0以上的(不包括4.3.0)。
在编译过程中,也许你需要进行多次编译才能编译成功,所以,这个过程刚开始有点难熬,不过很有意思.
1、编译binutils的时候出现错误
当运行下面步骤时:
make -C ld LIB_PATH=/tools/lib
/tools/bin/ld: unrecognized option '--hash-style=both'
/tools/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[2]: *** [ld-new] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make: *** [all-recursive-am] Error 2
make: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
通过google搜索,在博客http://blog.chinaunix.net/u1/57069/showart_512313.html
上得到了下面的解决方法.
make -C ld LIB_PATH=/tools/lib CC="gcc -B/usr/bin/"
编译成功
另外的,在第一遍安装GCC也遇到一样的问题,只要要把CC="gcc -B/usr/bin/"放在./configure前面
就OK了.
2、glibc-build/csu/version-info.h中会出现“\""的语法错误,只要更正即可.
3、如果在编译glic过程中出现下面的错误
/home/patrick/glibc-build/elf/librtld.os: In function `print_statistics':
/home/patrick/glibc-2.5.1/elf/rtld.c:2830: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `process_dl_debug':
/home/patrick/glibc-2.5.1/elf/rtld.c:2466: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `process_envvars':
/home/patrick/glibc-2.5.1/elf/rtld.c:2725: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `dl_main':
/home/patrick/glibc-2.5.1/elf/rtld.c:2346: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `print_search_path':
/home/patrick/glibc-2.5.1/elf/dl-load.c:1571: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os:/home/patrick/glibc-2.5.1/elf/dl-load.c:1791: more undefined
那么,这个时候需要重新编译gcc,在gcc的配置文件中将变量CFLAGS添加 -fno-stack-protector,即
关闭堆栈保护,再进行glibc的编译即可解决.
4、如果编译glibc的过程中出现类似下面的错误
/tmp/cclA2UVR.s:55: Error: suffix or operands invalid for `fnstsw'
可以知道,这是因为glibc版本太低的问题,只要打上补丁即可,或者是直接更改源代码,这个需要更改的
文件为/mnt/lfs/sources/glibc-2.*/sysdeps/i386/fpu/ftestexcept.c
之后将int temp改为short temp即可.
(动态更新中)
在编译安装过程中,一定要选好编译环境,如果你要进行LFS6.3以下的,那么不推荐使用高于或者是等于4.2版本的gcc,4.1最好。如果你要进行的LFS6.4,那么不应该使用4.3.0以上的(不包括4.3.0)。
在编译过程中,也许你需要进行多次编译才能编译成功,所以,这个过程刚开始有点难熬,不过很有意思.
1、编译binutils的时候出现错误
当运行下面步骤时:
make -C ld LIB_PATH=/tools/lib
/tools/bin/ld: unrecognized option '--hash-style=both'
/tools/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[2]: *** [ld-new] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
make: *** [all-recursive-am] Error 2
make: Leaving directory `/mnt/lfs/sources/binutils-build/ld'
通过google搜索,在博客http://blog.chinaunix.net/u1/57069/showart_512313.html
上得到了下面的解决方法.
make -C ld LIB_PATH=/tools/lib CC="gcc -B/usr/bin/"
编译成功
另外的,在第一遍安装GCC也遇到一样的问题,只要要把CC="gcc -B/usr/bin/"放在./configure前面
就OK了.
2、glibc-build/csu/version-info.h中会出现“\""的语法错误,只要更正即可.
3、如果在编译glic过程中出现下面的错误
/home/patrick/glibc-build/elf/librtld.os: In function `print_statistics':
/home/patrick/glibc-2.5.1/elf/rtld.c:2830: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `process_dl_debug':
/home/patrick/glibc-2.5.1/elf/rtld.c:2466: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `process_envvars':
/home/patrick/glibc-2.5.1/elf/rtld.c:2725: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `dl_main':
/home/patrick/glibc-2.5.1/elf/rtld.c:2346: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os: In function `print_search_path':
/home/patrick/glibc-2.5.1/elf/dl-load.c:1571: undefined reference to `__stack_chk_fail_local'
/home/patrick/glibc-build/elf/librtld.os:/home/patrick/glibc-2.5.1/elf/dl-load.c:1791: more undefined
那么,这个时候需要重新编译gcc,在gcc的配置文件中将变量CFLAGS添加 -fno-stack-protector,即
关闭堆栈保护,再进行glibc的编译即可解决.
4、如果编译glibc的过程中出现类似下面的错误
/tmp/cclA2UVR.s:55: Error: suffix or operands invalid for `fnstsw'
可以知道,这是因为glibc版本太低的问题,只要打上补丁即可,或者是直接更改源代码,这个需要更改的
文件为/mnt/lfs/sources/glibc-2.*/sysdeps/i386/fpu/ftestexcept.c
之后将int temp改为short temp即可.
(动态更新中)
相关阅读 更多 +
排行榜 更多 +