GCC:拾取错误版本的标题

GCC:拾取错误版本的标题,gcc,llvm,clang,glibc,Gcc,Llvm,Clang,Glibc,我下载并开始构建LLVM/CLANG。我最初安装了gcc版本4.1.2 20080704(Red Hat 4.1.2-48),但LLVM网站声明使用更高版本。因此,我下载并编译/构建了GCC版本4.7.2(GCC)。现在,我在设置以下配置后开始构建LLVM: # setenv PATH /usr/local/lib:/usr/local/lib64:$PATH # setenv LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64/ # setenv

我下载并开始构建LLVM/CLANG。我最初安装了gcc版本4.1.2 20080704(Red Hat 4.1.2-48),但LLVM网站声明使用更高版本。因此,我下载并编译/构建了GCC版本4.7.2(GCC)。现在,我在设置以下配置后开始构建LLVM:

# 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
请注意,GCC4.1.2可用的路径是/usr/bin,而默认情况下,我在/usr/local/bin中找到了4.7.2的路径

但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>
llvm-3.1.src/projects/compiler-rt/lib/asan/asan_posix.cc
#包括
提前感谢运行:

./configure --help /配置-帮助 显示此选项:

--with-gcc-toolchain Directory where gcc is installed. --使用安装gcc的gcc工具链目录。 因此,请尝试:

--with-gcc-toolchain /usr/local --使用gcc工具链/usr/local
而且不要设置任何环境变量。

在CentOS上,我也有这个问题。不完全相同的症状,但使用gcc 4.7.2。我放弃了,而是下载了rpm,它工作得很好。我建议先问一下。我没有得到一个完整的具体选项,但用DESTDIR=/usr安装最新的GCC或配置--prefix=/usr解决了这个问题。请注意,这样我只能使用最新版本的GCC。链接中还提到了另一种方法:但由于旧版本我没有任何代码、二进制文件或RPM,所以我重新安装了最新版本one@Prakash你现在把你的系统搞砸了。您不应该安装到/usr中。这是为通过软件包管理器安装的软件保留的。例如,现在您可能会被操作系统更新覆盖文件。而且没有真正的方法来清理它,因为你不能卸载手动安装的软件。