Skip to content

Commit 4c5e01a

Browse files
authored
Adds compatibility with LLVM 15 (#1585)
* Adds compatibility with LLVM 15 * Update `bap-llvm.opam`
1 parent 0e3966a commit 4c5e01a

File tree

8 files changed

+12
-6
lines changed

8 files changed

+12
-6
lines changed

bap-llvm.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ build: [
4343
]
4444

4545
depexts: [
46-
["clang" "libncurses5-dev"] {os-distribution = "ubuntu"}
46+
["clang" "libncurses5-dev" "libzstd-dev"] {os-distribution = "ubuntu"}
4747
["clang"] {os-distribution = "debian"}
4848
["clang" "libxml2-dev"] {os-distribution = "alpine"}
4949
["clang"] {os-distribution = "fedora"}

bap-llvm.opam.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build: [
2020
]
2121

2222
depexts: [
23-
["clang" "libncurses5-dev"] {os-distribution = "ubuntu"}
23+
["clang" "libncurses5-dev" "libzstd-dev"] {os-distribution = "ubuntu"}
2424
["clang"] {os-distribution = "debian"}
2525
["clang" "libxml2-dev"] {os-distribution = "alpine"}
2626
["clang"] {os-distribution = "fedora"}

lib/bap_llvm/config/llvm_configurator.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let () = C.main ~args ~name:"bap-llvm" @@ fun self ->
3333
C.Flags.write_sexp "link.flags" @@ List.concat [
3434
llvm self ["--link-static"; "--ldflags"];
3535
llvm self (["--link-static"; "--libs"] @ llvm_components);
36-
["-lstdc++"; "-lcurses"];
36+
["-lstdc++"; "-lcurses"; "-lzstd"];
3737
];
3838
C.Flags.write_sexp "cxx.flags" @@ List.concat [
3939
["-fPIC"];

lib/bap_llvm/llvm_disasm.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include <llvm/MC/MCInstPrinter.h>
44
#include <llvm/MC/MCInstrInfo.h>
55
#include <llvm/MC/MCRegisterInfo.h>
6+
#if LLVM_VERSION_MAJOR >= 15
7+
#include <llvm/MC/MCSubtargetInfo.h>
8+
#endif
69
#include <llvm/Support/DataTypes.h>
710
#include <llvm/Support/FormattedStream.h>
811
#include <llvm/Support/CommandLine.h>

lib/bap_llvm/llvm_pdb_loader.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050

5151
#include <llvm/Object/COFF.h>
5252
#include <llvm/Object/Binary.h>
53+
#if LLVM_VERSION_MAJOR >= 15
54+
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
55+
#endif
5356
#include "llvm/DebugInfo/PDB/PDB.h"
5457
#include "llvm/DebugInfo/PDB/PDBTypes.h"
5558
#include "llvm/DebugInfo/PDB/IPDBSession.h"

oasis/llvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Library bap_llvm
1818
Bap_llvm_config,
1919
Bap_llvm_disasm
2020
CCOpt: $cc_optimization
21-
CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses
21+
CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses -lzstd
2222
CSources: llvm_disasm.h,
2323
llvm_disasm.c,
2424
llvm_stubs.c,

vagrant/trusty64/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Vagrant.configure(2) do |config|
88
end
99
config.vm.provision "shell", privileged: false, inline: <<-SHELL
1010
sudo apt-get update
11-
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes
11+
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev libzstd-dev --yes
1212
1313
wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz
1414
tar xvf bubblewrap-0.3.1.tar.xz

vagrant/xenial64/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Vagrant.configure(2) do |config|
88
end
99
config.vm.provision "shell", privileged: false, inline: <<-SHELL
1010
sudo apt-get update
11-
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev --yes
11+
sudo apt-get install make git m4 libcap-dev gcc unzip libncurses5-dev libzstd-dev --yes
1212
1313
wget https://github.com/projectatomic/bubblewrap/releases/download/v0.3.1/bubblewrap-0.3.1.tar.xz
1414
tar xvf bubblewrap-0.3.1.tar.xz

0 commit comments

Comments
 (0)