2012-11-29 2 views
2

LLVM/CLANG를 다운로드하여 빌드하기 시작했습니다. 나는 처음에 gcc 버전 4.1.2 20080704 (Red Hat 4.1.2-48)를 설치했지만 LLVM 웹 사이트는 더 높은 버전을 사용하도록 명시했습니다. 그래서 나는 GCC gcc 버전 4.7.2 (GCC)를 다운로드하고 컴파일/빌드했다.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/local/bin에 그것을 발견 4.7.2의 상태는/usr/빈은 경로 : 지금은 아래의 설정을 설정 한 후 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 빌드 진술 실패 오류가 파일/코드 아래에 있습니다.

미리개
llvm-3.1.src/projects/compiler-rt/lib/asan/asan_posix.cc 

#include <algorithm> 

덕분에

+0

CentOS에서 문제가 있습니다. 정확히 같은 증상은 아니지만 gcc 4.7.2를 사용하십시오. 포기하고 대신 rpm을 다운로드하고 잘 작동합니다. – cdarke

답변

1

은 실행 :

--with-gcc-toolchain /usr/local

을 그리고 모든 환경 변수를 설정하지 : 그래서 시도

--with-gcc-toolchain Directory where gcc is installed.

:

./configure --help

이 옵션을 보여줍니다 에스.

+0

동일한 문제가 발생하지 않았습니다. – Prakash

+1

[LLVM 메일 링리스트] (http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev)에 문의하는 것이 좋습니다. –

+0

완전한 구체적인 옵션을 얻지 못했지만 최신 GCC를 DESTDIR =/usr 또는 --prefix =/usr과 함께 설치하면이 문제가 해결되었습니다. 이 방법으로 GCC의 최신 버전만을 사용해야합니다. 다른 방법은 http://gcc.gnu.org/faq.html#multiple 링크에 언급되어 있습니다. 이전 버전의 경우 코드, 바이너리 또는 RPM이 없으므로 최신 코드를 다시 설치했습니다. – Prakash

관련 문제