您的位置:首页 > 编程语言 > Qt开发

MIPS下编译QT4.8.0的__tls_get_addr找不到错误

2012-02-07 14:47 615 查看
用arm可以成功编译QT4.8.0, 但用mips编译的时候却碰到如下错误:

obj/release-shared-emb-mips/qthread_unix.o: In function `set_thread_data(QThreadData*)':
qthread_unix.cpp.text+0xec): undefined reference to `__tls_get_addr'
.obj/release-shared-emb-mips/qthread_unix.o: In function `QThreadData::current()':
qthread_unix.cpp.text+0x708): undefined reference to `__tls_get_addr'
collect2: ld returned 1 exit status


我的mips版本是4.4.5的。

去看了下/src/corelib/thread目录下的qthread_unix.cpp文件, 发现HAVE_TLS宏打开了才会导致错误,

关掉该宏后再编译, 果然通过了。

于是就打了如下补丁:

--- old/src/corelib/thread/qthread_unix.cpp      2012-02-07 14:46:10.000000000 +0800
+++ new/qthread_unix.cpp       2012-02-07 12:59:19.000000000 +0800
@@ -107,7 +107,7 @@
enum { ThreadPriorityResetFlag = 0x80000000 };

#if defined(Q_OS_LINUX) && defined(__GLIBC__) && (defined(Q_CC_GNU) || defined(Q_CC_INTEL))
-#define HAVE_TLS
+//#define HAVE_TLS
#endif
#if defined(Q_CC_XLC) || defined (Q_CC_SUN)
#define HAVE_TLS
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: