Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: undefined reference to llvm #143

Open
Aurze opened this issue Mar 25, 2021 · 1 comment
Open

error: undefined reference to llvm #143

Aurze opened this issue Mar 25, 2021 · 1 comment

Comments

@Aurze
Copy link

Aurze commented Mar 25, 2021

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?

@mukul-rathi
Copy link
Owner

mukul-rathi commented Mar 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants