在使用daikon建議的kvasir工具時,碰到一些問題,首先是由於該工具比較老,只支持內核最高爲2.6的linux系統,其次須要的glibc版本最高爲2.11(實在忍不住想吐個槽)。最後我把linux系統換成了fedora14,用yum安裝的glibc版本是2.13,只好手動安裝2.11版本的glibc。linux
tar -xvf glibc-2.5.tar.gzexpress
cd glibc-2.5 bash
mkdir glibc-2.11-build ide
cd glibc-2.11-build/ 工具
export CFLAGS="-g -O2 -march=i686"優化
../configure --prefix=/repo/root/TEST_PACKAGES/robot/PACKAGES/glibc-2.5 --with-headers=/usr/includeui
make unix
make installcode
注意:ci
1. 在目錄usr/src/glibc-2.11執行configure命令時不能執行,需在外部文件夾glibc-2.11-build 執行
2. 加上優化開關,export CFLAGS="-g -O2 -march=i686",不然會出現錯誤,此處的i686請參照本身的機器
3. 當有以下錯誤時:
checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... contains current directory
configure: error:
*** LD_LIBRARY_PATH shouldn't contain the current directory when
*** building glibc. Please change the environment variable
*** and run configure again.
解決辦法:查看LD_LIBRARY_PATH echo $LD_LIBRARY_PATH,個人打印的是/usr/lib/qt44/lib:
configure裏說:LD_LIBRARY_PATH不能以終結符做爲開始和最後一個字符,不能有2個終結符連在一塊兒,因此修改下LD_LIBRARY_PATH便可,export LD_LIBRARY_PATH=/usr/lib/qt44/lib
4. 當有以下錯誤時:
configure: error: gcc must provide the header
解決辦法:get the cpuid.h file from official GCC respositories> (http://gcc.gnu.org/viewcvs/tags/gcc_4_4_2_release/gcc/config/i386/cpuid.h?view=co)> and put it into /usr/include(上面指定的--with-headers)
5. 當有以下錯誤時:
../sysdeps/i386/fpu/s_frexp.S: Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for 「.ifdef」
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1′
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1′
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1′
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.’
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1′
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `’ in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: 「.endif」 without 「.if」
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx’ after expression
make[2]: *** [/opt/mylinux/build/glibc-build/math/s_frexp.os] Error 1
make[2]: Leaving directory `/opt/mylinux/build/glibc-2.12.2/math’
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/opt/mylinux/build/glibc-2.12.2′
make: *** [all] Error 2
修改兩個文件:
* sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. * nptl/sysdeps/pthread/pt-initfini.c: Ditto. Index: sysdeps/unix/sysv/linux/i386/sysdep.h =================================================================== --- sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) +++ sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) @@ -29,6 +29,10 @@ #include <dl-sysdep.h> #include <tls.h> +#if defined __i686 && defined __ASSEMBLER__ +#undef __i686 +#define __i686 __i686 +#endif /* For Linux we can use the system call table in the header file /usr/include/asm/unistd.h Index: nptl/sysdeps/pthread/pt-initfini.c =================================================================== --- nptl/sysdeps/pthread/pt-initfini.c (revision 1469) +++ nptl/sysdeps/pthread/pt-initfini.c (working copy) @@ -45,6 +45,11 @@ /* Embed an #include to pull in the alignment and .end directives. */ asm ("\n#include \"defs.h\""); +asm ("\n#if defined __i686 && defined __ASSEMBLER__"); +asm ("\n#undef __i686"); +asm ("\n#define __i686 __i686"); +asm ("\n#endif"); + /* The initial common code ends here. */ asm ("\n/*@HEADER_ENDS*/");
5. 當以上問題都解決時,make make install吧,因爲東西比較多,須要些時間,大概半小時左右。