-
Notifications
You must be signed in to change notification settings - Fork 2
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
ocaml backend fixes for pc, export offline lifter library #120
Conversation
0c4c77a
to
78c9e58
Compare
The last commit separates offline and asli into two separate packages, and makes it possible to build the offline lifter directly with dune (see commit message). If installing through opam asli needs to be explicitly installed first otherwise it tries to find it in the main opam repository.
|
should we turn off marshalling by default |
c5dce85
to
a870076
Compare
i saw this error while building via an opam pin (using the instructions at https://www.github.com/katrinafyi/aslp-web/pull/8). idk if this would happen with dune in a local checkout. #=== ERROR while compiling aslp_offline.0.2.0 =================================#
# context 2.3.0 | linux/x86_64 | ocaml.4.14.2 | pinned(git+https://github.com/UQ-PAC/aslp#export-offline-lifter#a870076de9b6f998120db2e1c910539338c7315f)
# path ~/.opam/default/.opam-switch/build/aslp_offline.0.2.0
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p aslp_offline -j 7 @install
# exit-code 1
# env-file ~/.opam/log/aslp_offline-114121-dcc48d.env
# output-file ~/.opam/log/aslp_offline-114121-dcc48d.out
### output ###
# Failed to gen 'aarch64_integer_pac_strip_dp_1src.0([],[LiftTime])': Unexpected runtime expression: gen_add_int.0 {{ }} ( gen_add_int.0 {{ }} ( gen_sub_int.0 {{ }} ( gen_sub_int.0 {{ }} ( gen_int_lit.0 {{ }} ( 56 ),gen_cvt_bits_uint.0 {{ 8 }} ( gen_load.0 {{ }} ( CalculateBottomPACBit143__3 ) ) ),gen_int_lit.0 {{ }} ( 1 ) ),gen_int_lit.0 {{ }} ( 1 ) ),gen_int_lit.0 {{ }} ( 8 ) )
# [...]
# Done generating ocaml lifter into '.'.
# (cd _build/default && /home/rina/.opam/default/bin/ocamlc.opt -cclib -lstdc++ -g -bin-annot -I bin/.offline_sem.eobjs/byte -I /home/rina/.opam/default/lib/asli/libASL -I /home/rina/.opam/default/lib/asli/libASL-stage0 -I /home/rina/.opam/default/lib/asli/libASL-stage1 -I /home/rina/.opam/default/lib/asli/libASL-support-native -I /home/rina/.opam/default/lib/asli/libASL-virtual -I /home/rina/.[...]
# File "bin/offline_sem.ml", line 2, characters 5-12:
# 2 | open Asl_ast
# ^^^^^^^
# Error: Unbound module Asl_ast
# (cd _build/default && /home/rina/.opam/default/bin/ocamlc.opt -cclib -lstdc++ -g -bin-annot -I bin/.offline_coverage.eobjs/byte -I /home/rina/.opam/default/lib/asli/libASL -I /home/rina/.opam/default/lib/asli/libASL-stage0 -I /home/rina/.opam/default/lib/asli/libASL-stage1 -I /home/rina/.opam/default/lib/asli/libASL-support-native -I /home/rina/.opam/default/lib/asli/libASL-virtual -I /home/r[...]
# File "bin/offline_coverage.ml", line 3, characters 5-12:
# 3 | open Asl_ast
# ^^^^^^^
# Error: Unbound module Asl_ast |
I can't reproduce this on either of my computers, here with tool versions:
I don't know why it would do that as offline_sem is still linking libASL directly. |
it looks like it was a my computer problem, my /home/rina/.opam/default/lib/asli/ was an scattered mix of multiple asli versions |
0df6261
to
fbe5d55
Compare
We now define two packages, asli and aslp_offline. The offline lifter library gets a different name depending on whether its built with pc support which is enabled by default in offlineASL/gen-command (breaking offline-coverage). libASL/dune now invokes asli to generate the lifter into the build directory. This makes everything buildable so the offline lifter should be useable as an opam pin dependency. Asli can generate the dune to build the offline lifter, but there is a little bit bit of manual mess, e.g. regarding the command to build asli. We also don't properly invalidate the cached marshalled generated lifter (which appears in _build/default/marshalled-offline-lifter-*) when we rebuild asli; to regenerate the lifter you must first run `dune clean`.
the install dependency was requiring a build of all packages. note, to install asli only, you will have to use `dune install -p asli`
this will also build asli if needed for the offline generation
- Moves Primops, Value and Symbolic into stage0 to support this - Some fixes for the previous commit
dd3a31f
to
4d99e40
Compare
4d99e40
to
a31041c
Compare
52d2cc6
to
9eafc90
Compare
9eafc90
to
6326e83
Compare
a5c5244
to
29ab7c1
Compare
Your changes look really good, |
asli.offline
so we can link it in gtirb_semantics?pc
, with the offline lifter producing a run-time error if its required and not provided. If the generated lifter is not configured to supply pc it just ignores the argument.