Skip to content

Commit

Permalink
updates bap to latest OCaml, switches to newer bitstrings (BinaryAnal…
Browse files Browse the repository at this point in the history
…ysisPlatform#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
  • Loading branch information
ivg authored Jan 26, 2022
1 parent d47ad14 commit 79dc047
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ jobs:
- name: Pin OASIS
run: opam pin add oasis https://github.com/BinaryAnalysisPlatform/oasis.git

- name: Install system dependencies
run: opam depext -u bap-extra

- name: Pin BAP
run: opam pin add bap . --no-action

- name: Install system dependencies
run: opam depext -u bap-extra
- name: Install rest of the system dependencies
run: opam depext -u bap

- name: Install Ghidra
run: |
Expand Down
1 change: 1 addition & 0 deletions OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ OCAMLFLAGS += -bin-annot # (create .cmt/.cmti files)
OCAMLFLAGS_ANNOT = -annot -bin-annot
OCAMLFLAGS += $(OCAMLFLAGS_ANNOT)
OCAMLFLAGS += -opaque
OCAMLFLAGS += -w -6-16-58
OCAMLOPTFLAGS += -O3

# Until this point we allow to override variables via the command-line.
Expand Down
4 changes: 3 additions & 1 deletion configure-omake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

export OPAMCLI=2.0

rm -f _oasis setup.log.om setup.data _oasis_setup.om
mv oasis/benchmarks oasis/benchmarks.backup
mv oasis/piqi-printers oasis/piqi-printers.backup
Expand All @@ -9,7 +11,7 @@ SECTIONS=`ocaml tools/oasis_sections.ml --sections --enable-everything`
SETUPS=`ocaml tools/collect.ml setup.ml $SECTIONS`
AB=`ocaml tools/collect.ml files.ab $SECTIONS`
ocaml tools/cat.ml '"\n# $name\n"' -- $SECTIONS $AB _oasis
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- $SETUPS setup.ml.in setup.ml
ocaml tools/cat.ml '"\n#1 \"$name\"\n"' -- setup.ml.pre.in $SETUPS setup.ml.in setup.ml
cp oasis/common.backup oasis/common
cp oasis/benchmarks.backup oasis/benchmarks
cp oasis/piqi-printers.backup oasis/piqi-printers
Expand Down
1 change: 1 addition & 0 deletions lib/bap/bap_init_toplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ open Bap_plugins.Std
let install_printer printer =
Topdirs.dir_install_printer Format.err_formatter
(Longident.parse printer)
[@@warning "-D"]

let install_printers () =
Core_kernel.Pretty_printer.all () |>
Expand Down
2 changes: 1 addition & 1 deletion oasis/elf-loader
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library elf
Path: lib/bap_elf
Build$: flag(everything) || flag(elf_loader)
FindlibName: bap-elf
BuildDepends: bitstring, bitstring.ppx, regular, core_kernel, ppx_bap
BuildDepends: bitstring, ppx_bitstring, regular, core_kernel, ppx_bap
Modules: Bap_elf
InternalModules:
Elf_parse,
Expand Down
2 changes: 1 addition & 1 deletion opam/opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bug-reports: "https://github.com/BinaryAnalysisPlatform/bap/issues"
depends: [
"ocaml" {>= "4.07.0"}
"base-unix"
"bitstring" {>= "3.0.0" & < "4.0.0"}
"ppx_bitstring" {>= "4.0.0"}
"camlzip"
"linenoise" {>= "1.1" & < "2.0"}
"cmdliner" {>= "1.0" & < "2.0"}
Expand Down
2 changes: 1 addition & 1 deletion plugins/mips/mips.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ let () =
Hashtbl.find_and_call Std.delayed_opcodes name
~if_found:(fun delay ->
KB.Value.put Insn.Slot.delay insn (Some delay))
~if_not_found:(fun _ -> insn)
~if_not_found:(fun _ -> Insn.empty)
else !!Insn.empty in
Bap_main.Extension.declare @@ fun _ctxt ->
KB.Rule.(declare ~package:"mips" "delay-slot" |>
Expand Down

0 comments on commit 79dc047

Please sign in to comment.