mukul-rathi / bolt

Bolt is a language with in-built data-race freedom!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: undefined reference to llvm

Aurze opened this issue · comments

Trying to build bolt on ubuntu and arch and I'm getting the following error when running bazel build //src/llvm-backend:main:

   1   │ Loading:
   2   │ Loading:
   3   │ Loading: 0 packages loaded
   4   │ Loading: 0 packages loaded
   5   │ Analyzing: target //src/llvm-backend:main (0 packages loaded, 0 targets configured)
   6   │ Analyzing: target //src/llvm-backend:main (0 packages loaded, 0 targets configured)
   7   │ INFO: Analyzed target //src/llvm-backend:main (0 packages loaded, 0 targets configured).
   8   │ INFO: Analyzed target //src/llvm-backend:main (0 packages loaded, 0 targets configured).
   9   │ INFO: Found 1 target...
  10   │ INFO: Found 1 target...
  11   │ [0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt
  12   │ [0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt
  13   │ ERROR: /home/nicolas/devel/bolt/src/llvm-backend/BUILD:3:10: Linking src/llvm-backend/main failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-fastbuild/bin/src/llvm-backend/main-2.params
  14   │
  15   │ Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-fastbuild/bin/src/llvm-backend/main-2.params
  16   │
  17   │ Use --sandbox_debug to see verbose messages from the sandbox
  18   │ ERROR: /home/nicolas/devel/bolt/src/llvm-backend/BUILD:3:10: Linking src/llvm-backend/main failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-fastbuild/bin/src/llvm-backend/main-2.params
  19   │
  20   │ Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-fastbuild/bin/src/llvm-backend/main-2.params
  21   │
  22   │ Use --sandbox_debug to see verbose messages from the sandbox
  23   │ external/llvm/clang+llvm-9.0.0-x86_64-pc-linux-gnu/lib/libLLVMCore.a(AsmWriter.cpp.o):AsmWriter.cpp:function writeDIExpression(llvm::raw_ostream&, llvm::DIExpression const*, (anonymous namespace)::TypePrinting*, llvm::SlotTracker*, llvm::Module const*): error: undefined ref
       │ erence to 'llvm::dwarf::OperationEncodingString(unsigned int)'
       | ..

I have change the llvm in both for the linux one. Is there anything addition I need to do to make it work?

Hmm, not sure. Is gcc set up correctly? A minimal example you might want to test your Bazel LLVM setup with is this repo: https://github.com/dgp1130/llvm-bazel-foolang/blob/master/llvm.bzl