New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bap with core v0.9 #704

merged 18 commits into from Oct 3, 2017


None yet
2 participants

ivg commented Sep 15, 2017

Updates bap to the latest OCaml infrastructure

  1. updates code to meet the interface changes in core v.0.9
  2. updates the build system to handle issues with the ppx_deriving

ivg and others added some commits Sep 14, 2017

makes it compilable with the new core
Most of the changes are due to the following breaking changes in the

1. change of the monad interface, now `bind` takes a function as a
labeled argument. This is the most annoying change, as we need to update
our Base interface to be consistent with Core, but this will force us to
release the 2.0 version.

2. The `equal` parameter for different finders now became mandatory (to
discourage people from using the polymorphic compare).

This will fix #648.
completely disables inline tests
The new inline tests from Janestreet doesn't work with the plugin
system. It is not even our tests, but core's own tests, that give
a runtime error.
picks llvm-3.8 for the CI opam file
I hope there is such on Travis.
maybe which doesn't work
so why it works for the cxx?
we need to set custom_ppx to prevent ppx_deriving
otherwise it will become a dependency, that is not really used.
supports building without ppx_deriving
the ppx_deriving is an optional depedency of many ppx_X packages from
Janestreet. The optionality is specified using a predicated
requirement. The problem is mostly in ocamlfind, that if there is no
`-pp` option will perform a query is made to build a preprocessor
command that doesn't include the predicates passed through the command
line, that lead to a failure, since ppx_deriving is not installed.

The workaround is simple - we need to pass the `-pp` option to the
linking phase - kind of stupid, but it will prevent the ocamlfind driver
from making this query.

The bap_build library was also update, I've added a set of default
predicates that are used when the set of bap dependencies is inferred.
pass the `-pp` flag to the c compler
Now it becomes more and more weird - as we need to pass the `-pp` flag
even when we are compiling a C file since the syntax command is still
build even there.
cleans the ppx dependencies
we are depending only on ppx_jane, and the dependcy is put into the
common section. Everything else is removed.
disables the bap_elf library
So due to issues with [ocamlfind][1] and the new generation of the ppx derivers
from the Janestreet we can't build the bap_elf library without a bogus
dependecy on ppx_deriving. A trick to supress this dependency from
jumping in was to specify a `-pp` flag, and we can't use this trick with
a library that uses camlp4. So we can only build it, if ppx_deriving is
installed (it is not actually used, it's needed just to keep ocamlfind

Since `ppx_deriving` is not really needed, and it usually lags behind
the compiler development, we decided to disable this library by
default, until we will rewrite it using `ppx_bitstrings`.

sets version to numeric and disables BAP_DEBUG
The latter probably is the cause of the "No space left on device"
error (since BAP_DEBUG will fill the /tmp folder with lots of trash).

The former will prevent the version test from passing.
solved warnings
Lots of warning occured because of new core_kernel version, mainly
connected with {in/out}_channel types, that should be now
{In/Out}_channel.t, according to Jane Street point of view
edited a travis env matrix
so now we will have 6 tests for 4.03, 4.04 and 4.05 compilers
with either BAP_RUN_TEST or BAP_RUN_CHECK set to true

gitoleg approved these changes Oct 3, 2017

@gitoleg gitoleg merged commit a6ce1f9 into BinaryAnalysisPlatform:master Oct 3, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@ivg ivg deleted the ivg:bap-with-core-v0.9 branch Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment