Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Building Clang

I am trying to build Clang on Linux (Amazon's EC2). I am running the make as per the guide at:

http://clang.llvm.org/get_started.html

I am getting the following link error messages:

llvm[2]: Linking Debug+Asserts executable opt
/home/ec2-user/benchmark/build/tools/opt/Debug+Asserts/opt.o: In function `llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, llvm::LLVMContext&)':
opt.cpp:(.text._ZN4llvm7ParseIREPNS_12MemoryBufferERNS_12SMDiagnosticERNS_11LLVMContextE[llvm::Pars    eIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, llvm::LLVMContext&)]+0x5f): undefined reference to `llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: ld returned 1 exit status
make[2]: *** [/home/ec2-user/benchmark/build/Debug+Asserts/bin/opt] Error 1
make[2]: Leaving directory `/home/ec2-user/benchmark/build/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/home/ec2-user/benchmark/build/tools'
make: *** [all] Error 1

Does anyone know what this means?

Edit: I rebuilt the entire project from svn and now I am getting the following error:

  COMPILE:   clang_linux/asan-i386/i386: /home/ec2-user/benchmark/llvm/projects/compiler-rt/lib/asan/asan_rtl.cc
/home/ec2-user/benchmark/llvm/projects/compiler-rt/lib/asan/asan_rtl.cc:28:10: fatal error: 'new' file not found
#include <new>
         ^
1 error generated.
make[5]: *** [/home/ec2-user/benchmark/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386/i386/SubDir.lib__asan/asan_rtl.o] Error 1
make[5]: Leaving directory `/home/ec2-user/benchmark/llvm/projects/compiler-rt'
make[4]: *** [BuildRuntimeLibraries] Error 2
make[4]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/ec2-user/benchmark/build/tools'
make: *** [all] Error 1
like image 614
user265445 Avatar asked Dec 22 '11 15:12

user265445


1 Answers

I followed this and I was able to build it successfully in the first shot itself.

I guess, you are hitting issues with your C++ standard library headers. So you need to follow the Step #6 in the above mentioned link!

Start a fresh build and please ensure that you satisfy this prerequisite.

like image 81
Sangeeth Saravanaraj Avatar answered Nov 07 '22 04:11

Sangeeth Saravanaraj