Skip to content

Commit

Permalink
Adds compatibility with LLVM 15 (#1585)
Browse files Browse the repository at this point in the history
* Adds compatibility with LLVM 15

* Update `bap-llvm.opam`
  • Loading branch information
bmourad01 authored Jun 8, 2023
1 parent 0e3966a commit 4c5e01a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bap-llvm.opam
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ build: [
]

depexts: [
["clang" "libncurses5-dev"] {os-distribution = "ubuntu"}
["clang" "libncurses5-dev" "libzstd-dev"] {os-distribution = "ubuntu"}
["clang"] {os-distribution = "debian"}
["clang" "libxml2-dev"] {os-distribution = "alpine"}
["clang"] {os-distribution = "fedora"}
Expand Down
2 changes: 1 addition & 1 deletion bap-llvm.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build: [
]

depexts: [
["clang" "libncurses5-dev"] {os-distribution = "ubuntu"}
["clang" "libncurses5-dev" "libzstd-dev"] {os-distribution = "ubuntu"}
["clang"] {os-distribution = "debian"}
["clang" "libxml2-dev"] {os-distribution = "alpine"}
["clang"] {os-distribution = "fedora"}
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_llvm/config/llvm_configurator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let () = C.main ~args ~name:"bap-llvm" @@ fun self ->
C.Flags.write_sexp "link.flags" @@ List.concat [
llvm self ["--link-static"; "--ldflags"];
llvm self (["--link-static"; "--libs"] @ llvm_components);
["-lstdc++"; "-lcurses"];
["-lstdc++"; "-lcurses"; "-lzstd"];
];
C.Flags.write_sexp "cxx.flags" @@ List.concat [
["-fPIC"];
Expand Down
3 changes: 3 additions & 0 deletions lib/bap_llvm/llvm_disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <llvm/MC/MCInstPrinter.h>
#include <llvm/MC/MCInstrInfo.h>
#include <llvm/MC/MCRegisterInfo.h>
#if LLVM_VERSION_MAJOR >= 15
#include <llvm/MC/MCSubtargetInfo.h>
#endif
#include <llvm/Support/DataTypes.h>
#include <llvm/Support/FormattedStream.h>
#include <llvm/Support/CommandLine.h>
Expand Down
3 changes: 3 additions & 0 deletions lib/bap_llvm/llvm_pdb_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@

#include <llvm/Object/COFF.h>
#include <llvm/Object/Binary.h>
#if LLVM_VERSION_MAJOR >= 15
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
#endif
#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/DebugInfo/PDB/PDBTypes.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
Expand Down
2 changes: 1 addition & 1 deletion oasis/llvm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Library bap_llvm
Bap_llvm_config,
Bap_llvm_disasm
CCOpt: $cc_optimization
CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses
CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses -lzstd
CSources: llvm_disasm.h,
llvm_disasm.c,
llvm_stubs.c,
Expand Down
2 changes: 1 addition & 1 deletion vagrant/trusty64/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vagrant.configure(2) do |config|
end
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-get update
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev libzstd-dev --yes
wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz
tar xvf bubblewrap-0.3.1.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion vagrant/xenial64/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vagrant.configure(2) do |config|
end
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-get update
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev libzstd-dev --yes
wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz
tar xvf bubblewrap-0.3.1.tar.xz
Expand Down

0 comments on commit 4c5e01a

Please sign in to comment.