7

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
user265445
  • 341
  • 1
  • 4
  • 11
  • Are you building with autotools or with cmake? – SK-logic Dec 23 '11 at 09:09
  • When I tried the build on Windows I used cmake as per the instructions but this didn't work either. Now I am doing this on Linux and just using the configure command followed by make as per Step (5). I am not sure what the autotools are? – user265445 Dec 27 '11 at 00:00

1 Answers1

2

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.

Sangeeth Saravanaraj
  • 16,027
  • 21
  • 69
  • 98
  • I started over, followed step #6, and I am still getting the second error I mentioned in my question (I also edited the question to add the full text of the second error message). Any other ideas on what I may be doing wrong? – user265445 Dec 26 '11 at 23:54
  • on step 7, I got the following error message: CMake 2.8.12.2 or higher is required. You are running version 2.8.12 I tried upgrading cMake, but system does not recognize that. – Junchen Oct 03 '15 at 20:25