Skip to content
This repository was archived by the owner on Oct 18, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ env:
- OCAML_VERSION=4.05
- OCAML_VERSION=4.06
- OCAML_VERSION=4.07
# Enable when 4.08 is released
# - OCAML_VERSION=4.08
1 change: 1 addition & 0 deletions mirage-xen-ocaml.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ depends: [
"conf-pkg-config"
"ocamlfind" {build}
"ocaml-src"
"mmap"
]
substs: [
"xen-ocaml/flags/cflags.tmp"
Expand Down
20 changes: 14 additions & 6 deletions xen-ocaml/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,21 @@ case $OCAMLOPT_VERSION in
exit 1
;;
esac
# This directory doesn't really exist on 4.08, but it's also unneeded, so it's
# effectively harmless to leave it here.
CFLAGS="$CFLAGS -I../../byterun"
cd otherlibs/bigarray && make CFLAGS="${CFLAGS} -I../unix -DIN_OCAML_BIGARRAY" ${BIGARRAY_OBJ}
ar rcs ../../libxenotherlibs.a ${BIGARRAY_OBJ}

cd ../../..
case $OCAMLOPT_VERSION in
4.04.2|4.05.*|4.06.*|4.07.*)
CFLAGS="$CFLAGS -I../../byterun" cd otherlibs/bigarray && make CFLAGS="${CFLAGS} -I../unix -DIN_OCAML_BIGARRAY" ${BIGARRAY_OBJ}
ar rcs ../../libxenotherlibs.a ${BIGARRAY_OBJ}
cd ../../..
;;
4.08.*)
cp `ocamlfind query mmap`/libmmap_stubs.a libxenotherlibs.a
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diml I think in mirage-platform we only need the stubs (mmap.o and mmap_ba.o). Is this the right way to do it, or is libmmap_stubs.a a name private to Dune?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you need these C functions in a xen-MirageOS-kernel, you'll need to cross-compile them with appropriate CFLAGS and includes. see https://github.com/mirage/checkseum / https://github.com/inhabitedtype/bigstringaf on how to do this.

cd ..
;;
*) echo unsupported OCaml version $OCAMLOPT_VERSION
exit 1
;;
esac

echo "($(pkg-config libminios-xen --libs)$(pkg-config openlibm --libs)$(cat flags/libs.tmp))" > flags/libs
echo "($(pkg-config libminios-xen --cflags)$(pkg-config openlibm --cflags)$(cat flags/cflags.tmp))" > flags/cflags