Fedora14系统解决 解决undefined reference to `__fdelt_chk@GLIBC_2.15'的问题 日志

环境配置:Fedora14

在Qt环境编译的程序执行文件,执行运行时报错 undefined reference to `__fdelt_chk@GLIBC_2.15’

用strings /lib/libc.so.6 |grep GLIBC_ 查看系统glibc的版本太低了,需要更新版本

到官网下载:ftp://ftp.gnu.org/gnu/glibc/

下载并安装指令:

wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz
tar -zxf glibc-2.15.tar.gz

cd glibc-build-2.15
mkdir build
cd build 

../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin


make all && make install

 

解决错误

sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"

1.修改文件pt-initfini.c

在glibc源码目录下找到文件 nptl/sysdeps/pthread/pt-initfini.c,约在46行左右:asm ("\n#include \"defs.h\"");

在其后增加代码:

asm ("\n#if defined __i686 && defined __ASSEMBLER__");
asm ("\n#undef __i686");
asm ("\n#define __i686 __i686");
asm ("\n#endif");

2.修改文件sysdep.h

在glibc源码目录下找到文件 sysdeps/unix/sysv/linux/i386/sysdep.h ,约在30行左右:#include <tls.h>

在其后增加代码:

#if defined __i686 && defined __ASSEMBLER__
#undef __i686
#define __i686 __i686
#endif

3.重新编译

make all && make install

猜你喜欢

转载自blog.csdn.net/ggggyj/article/details/106047057