0

I am trying to build LLVM from source in FreeBSD 8.4. Here are the steps i carried out

  1. Downloaded the source from http://llvm.org/releases/3.8.0/llvm-3.8.0.src.tar.xz
  2. Extracted the source into a folder.
  3. Created a build directory and inside it ran $ cmake ../llvm-3.8.0.src
  4. Started the build using $cmake --build .

It throws the following error

/home/spangeni/llvm/llvm-3.8.0.src/lib/TableGen/TGLexer.cpp: In member function 'llvm::tgtok::TokKind llvm::TGLexer::LexNumber()':
/home/spangeni/llvm/llvm-3.8.0.src/lib/TableGen/TGLexer.cpp:393:48: error: 'strtoll' was not declared in this scope
       CurIntVal = strtoll(NumStart, nullptr, 16);
                                                ^
/home/spangeni/llvm/llvm-3.8.0.src/lib/TableGen/TGLexer.cpp:398:60: error: 'strtoull' was not declared in this scope
         CurIntVal = (int64_t)strtoull(NumStart, nullptr, 16);
                                                            ^
/home/spangeni/llvm/llvm-3.8.0.src/lib/TableGen/TGLexer.cpp:414:47: error: 'strtoll' was not declared in this scope
       CurIntVal = strtoll(NumStart, nullptr, 2);
                                               ^
/home/spangeni/llvm/llvm-3.8.0.src/lib/TableGen/TGLexer.cpp:429:44: error: 'strtoll' was not declared in this scope
   CurIntVal = strtoll(TokStart, nullptr, 10);

GCC Version = 4.9.2 CMAKE version = 3.2.3

I also tried to include stdlib.h in the file llvm-3.8.0.src/lib/TableGen/TGLexer.cpp. This din't help.

Is there any configuration I am missing ?

sushil
  • 165
  • 1
  • 9

1 Answers1

2

The ports system exists for a good reason - many (pretty much all nontrivial) software needs patches and build tweaks to build and work properly. So my advice would be just that: use Ports.

Not sure if ports actually supports FreeBSD 8.4, though. Do you have any particular reason to use such an old release?