errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference

1、编译ucspi-tcp-0.88遇到问题
./load tcpserver rules.o remoteinfo.o timeoutconn.o cdb.a \
dns.a time.a unix.a byte.a  `cat socket.lib`
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in tcpserver.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [tcpserver] 错误 1
[root@phpdba ucspi-tcp-0.88]# vim tcpserver.c

#include <errno.h> //添加这行,编译通过
#include “error.h”

2、编译qmail遇到同类问题

[root@phpdba qmail-1.03]# make setup check
./load auto-str substdio.a error.a str.a
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in substdio.a(substdo.o)
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [auto-str] 错误 1

解决方法:

[root@muxuyuan1 qmail-1.03]# vim compile
exec cc -O2 -c ${1+”$@”}
修改为:
exec cc -include /usr/include/errno.h -O2 -c ${1+”$@”}

此条目发表在技术生涯分类目录。将固定链接加入收藏夹。