Skip to content

Commit 79dc047

Browse files
authored
updates bap to latest OCaml, switches to newer bitstrings (#1413)
* switches to bitstring 4.x * removes warnings in omake-configure * removes unnecessary warnings * installs extra dependencies before pinning bap as we take them from the upstream opam-repository bap-extra package * temporary uses the PR1413 to test switching to bitstring 4.x * we still need to use opam/opam depexts to install dejagnu * the tests are passing, reverts back the branch name
1 parent d47ad14 commit 79dc047

File tree

7 files changed

+13
-6
lines changed

7 files changed

+13
-6
lines changed

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ jobs:
2828
- name: Pin OASIS
2929
run: opam pin add oasis https://github.com/BinaryAnalysisPlatform/oasis.git
3030

31+
- name: Install system dependencies
32+
run: opam depext -u bap-extra
33+
3134
- name: Pin BAP
3235
run: opam pin add bap . --no-action
3336

34-
- name: Install system dependencies
35-
run: opam depext -u bap-extra
37+
- name: Install rest of the system dependencies
38+
run: opam depext -u bap
3639

3740
- name: Install Ghidra
3841
run: |

OMakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ OCAMLFLAGS += -bin-annot # (create .cmt/.cmti files)
3333
OCAMLFLAGS_ANNOT = -annot -bin-annot
3434
OCAMLFLAGS += $(OCAMLFLAGS_ANNOT)
3535
OCAMLFLAGS += -opaque
36+
OCAMLFLAGS += -w -6-16-58
3637
OCAMLOPTFLAGS += -O3
3738

3839
# Until this point we allow to override variables via the command-line.

configure-omake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
export OPAMCLI=2.0
4+
35
rm -f _oasis setup.log.om setup.data _oasis_setup.om
46
mv oasis/benchmarks oasis/benchmarks.backup
57
mv oasis/piqi-printers oasis/piqi-printers.backup
@@ -9,7 +11,7 @@ SECTIONS=`ocaml tools/oasis_sections.ml --sections --enable-everything`
911
SETUPS=`ocaml tools/collect.ml setup.ml $SECTIONS`
1012
AB=`ocaml tools/collect.ml files.ab $SECTIONS`
1113
ocaml tools/cat.ml '"\n# $name\n"' -- $SECTIONS $AB _oasis
12-
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- $SETUPS setup.ml.in setup.ml
14+
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- setup.ml.pre.in $SETUPS setup.ml.in setup.ml
1315
cp oasis/common.backup oasis/common
1416
cp oasis/benchmarks.backup oasis/benchmarks
1517
cp oasis/piqi-printers.backup oasis/piqi-printers

lib/bap/bap_init_toplevel.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ open Bap_plugins.Std
33
let install_printer printer =
44
Topdirs.dir_install_printer Format.err_formatter
55
(Longident.parse printer)
6+
[@@warning "-D"]
67

78
let install_printers () =
89
Core_kernel.Pretty_printer.all () |>

oasis/elf-loader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Library elf
77
Path: lib/bap_elf
88
Build$: flag(everything) || flag(elf_loader)
99
FindlibName: bap-elf
10-
BuildDepends: bitstring, bitstring.ppx, regular, core_kernel, ppx_bap
10+
BuildDepends: bitstring, ppx_bitstring, regular, core_kernel, ppx_bap
1111
Modules: Bap_elf
1212
InternalModules:
1313
Elf_parse,

opam/opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bug-reports: "https://github.com/BinaryAnalysisPlatform/bap/issues"
99
depends: [
1010
"ocaml" {>= "4.07.0"}
1111
"base-unix"
12-
"bitstring" {>= "3.0.0" & < "4.0.0"}
12+
"ppx_bitstring" {>= "4.0.0"}
1313
"camlzip"
1414
"linenoise" {>= "1.1" & < "2.0"}
1515
"cmdliner" {>= "1.0" & < "2.0"}

plugins/mips/mips.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let () =
101101
Hashtbl.find_and_call Std.delayed_opcodes name
102102
~if_found:(fun delay ->
103103
KB.Value.put Insn.Slot.delay insn (Some delay))
104-
~if_not_found:(fun _ -> insn)
104+
~if_not_found:(fun _ -> Insn.empty)
105105
else !!Insn.empty in
106106
Bap_main.Extension.declare @@ fun _ctxt ->
107107
KB.Rule.(declare ~package:"mips" "delay-slot" |>

0 commit comments

Comments
 (0)