我下载并开始构建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