Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
647 views
in Technique[技术] by (71.8m points)

c++ - How do I build an llvm-pass and then use clang to load the generated shared library in another rule?

I have the following project structure:

llvm-pass/
  CMakeLists.txt
  BUILD
program/
  main.cc
  BUILD
WORKSPACE

In llvm-pass/BUILD

cmake_external(
  name="llvm-pass",
  output="llvm-pass.so"
)

In program/BUILD

cc_binary(
  name="program",
  srcs = ["main.cc"],
  copts = ["-Xclang -load ???"],
  data = ["//llvm-pass"]
)

I don't know how to determine the path of the llvm-pass object so that I may pass it as an argument to the program compilation rule. Any ideas?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...