在使用daikon建议的kvasir工具时,碰到一些问题,首先是因为该工具比较老,只支持内核最高为2.6的linux系统,其次需要的glibc版本最高为2.11(实在忍不住想吐个槽)。最后我把linux系统换成了fedora14,用yum安装的glibc版本是2.13,只好手动安装2.11版本的glibc。
-
cd /usr/src
-
mkdir glibc-2.11-build
-
wget http://ftp.gnu.org/pub/gnu/glibc/glibc-2.11.tar.gz
-
tar zxvf glibc-2.11.tar.gz
-
cd /usr/src/glibc-2.11-build/
-
export CFLAGS="-g -O2 -march=i686"
-
/usr/src/glibc-2.11/configure --prefix=/usr/src/glibc-2.11-build/ --with-headers=/usr/include
-
make
-
make install
注意:
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
在include后面加上
#if defined __i686 && defined __ASSEMBLER__
#undef __i686
#define __i686 __i686
#endif