歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Ubuntu Linux >> Ubuntu10.10安裝arm版本的Qt遇到error: thread-local storage no

Ubuntu10.10安裝arm版本的Qt遇到error: thread-local storage no

日期:2017/3/3 17:00:14   编辑:Ubuntu Linux

 Ubuntu10.10安裝arm版本的Qt遇到error: thread-local storage not supported for this target

  用arm編譯的時候卻碰到如下錯誤:

  thread/qthread_unix.cpp:117: error: thread-local storage not supported for this target

  make[1]: *** [.obj/release-shared-emb-arm/qthread_unix.o] 錯誤 1

  make[1]:正在離開目錄 `/home/soft/qtenv/arm/src/corelib'

  make: *** [sub-corelib-make_default-ordered] 錯誤 2

  #

  去看了下/src/corelib/thread目錄下

  -rwxr--r-- 1 fsp fsp 20122 2012-03-14 22:01 qthread_unix.cpp*

  -rw-r--r-- 1 fsp fsp 18695 2012-03-14 22:01 qthread_win.cpp

  -rw-r--r-- 1 fsp fsp 2684 2012-03-14 22:01 qwaitcondition.h

  -rw-r--r-- 1 fsp fsp 6163 2012-03-14 22:01 qwaitcondition.qdoc

  -rw-r--r-- 1 fsp fsp 5730 2012-03-14 22:01 qwaitcondition_symbian.cpp

  -rw-r--r-- 1 fsp fsp 6094 2012-03-14 22:01 qwaitcondition_unix.cpp

  -rw-r--r-- 1 fsp fsp 6418 2012-03-14 22:01 qwaitcondition_win.cpp

  -rw-r--r-- 1 fsp fsp 1259 2012-03-14 22:01 thread.pri

  # vi qthread_unix.cpp

  打開文件, 發現HAVE_TLS宏打開了才會導致錯誤,

  關掉該宏後再編譯, 果然通過了。

  於是就打了如下補丁:

  110 #define HAVE_TLS

  111 #endif

  112 #if defined(Q_CC_XLC) || defined (Q_CC_SUN)

  113 #define HAVE_TLS

  114 #endif

  115

  116 #ifdef HAVE_TLS

  117# static __thread QThreadData *currentThreadData = 0;

  118 #endif

Copyright © Linux教程網 All Rights Reserved