我下載並開始構建LLVM/CLANG。我最初安裝了gcc版本4.1.2 20080704(紅帽4.1.2-48),但LLVM網站聲稱使用更高版本。於是我下載並編譯/構建了GCC gcc版本4.7.2(GCC)。現在,我開始設置下面的配置後建立LLVM:GCC:拾取錯誤版本的標題
# setenv PATH /usr/local/lib:/usr/local/lib64:$PATH
# setenv LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64/
# setenv CC /usr/local/bin/gcc
記下GCC 4.1.2可用的是/ usr/bin中,而4.7.2我發現它在/ usr/local/bin目錄的路徑默認
但LLVM編譯失敗說明:
In file included from /x/home/satprasad/llvm/llvm-3.1.src/projects/compiler-rt/lib/asan/asan_posix.cc:35:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:64:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:69:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:45:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux/bits/c++io.h:38:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux/bits/gthr.h:132:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux/bits/gthr-default.h:100:1: error: weakref declaration must have
internal linkage
__gthrw(pthread_once)
但它應該選擇的文件/頭爲4.7.2版本4.1.2沒有的 - 你可以請讓我知道如何解決這個問題 - 行給出錯誤的文件/代碼如下:
llvm-3.1.src/projects/compiler-rt/lib/asan/asan_posix.cc
#include <algorithm>
在此先感謝
我在CentOS上也遇到了這個問題。不完全一樣的症狀,但使用gcc 4.7.2。我放棄並下載了轉速,而且工作正常。 – cdarke