MIPS下编译QT4.8.0的__tls_get_addr找不到问题
发布时间:2021-11-24 14:33:46 所属栏目:教程 来源:互联网
导读:用arm可以成功编译QT4.8.0, 但用mips编译的时候却碰到如下错误: [html] 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-sha
用arm可以成功编译QT4.8.0, 但用mips编译的时候却碰到如下错误: [html] 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宏打开了才会导致错误, 关掉该宏后再编译, 果然通过了。 于是就打了如下补丁: [html] ? --- 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 ![]() (编辑:我爱故事小小网_铜陵站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |