Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #192 from avsm/4.04-5-support
Browse files Browse the repository at this point in the history
support 4.04.2 and partially 4.05.0
  • Loading branch information
avsm authored Jul 14, 2017
2 parents afb4aab + 6989696 commit 807616f
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 336 deletions.
4 changes: 1 addition & 3 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ fi

export OPAMYES=1
export OPAMVERBOSE=1
export CI_CFLAGS=-Werror
#export CI_CFLAGS=-Werror

eval `opam config env`

opam remote add dev https://github.com/mirage/mirage-dev.git

opam pin add -n mirage-xen-posix .
opam pin add -n mirage-xen-ocaml .
opam pin add -n mirage-xen .
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ language: c
script: bash -ex .travis-ci.sh
sudo: required
env:
- OCAML_VERSION=4.02
- OCAML_VERSION=4.03
- OCAML_VERSION=4.04
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 3.0.4

* remove support for versions of OCaml older than 4.04.2, and add support
for OCaml 4.04.2 and OCaml 4.05.0. For older revisions of OCaml, use
an older revision of mirage-xen-ocaml.

## 3.0.3 (2017-06-16)
* xen: we need io-page-xen because
- mirage-xen depends on xen-gnt (for suspend/resume callbacks)
Expand Down
2 changes: 1 addition & 1 deletion mirage-xen-ocaml.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ depends: [
"ocaml-src"
"ocamlbuild" {build}
]
available: [ocaml-version >= "4.01.0" & os = "linux"]
available: [ocaml-version >= "4.04.2" & ocaml-version <= "4.05.0" & os = "linux"]
37 changes: 18 additions & 19 deletions xen-ocaml/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,38 @@ fi
CC=${CC:-cc}
PWD=`pwd`
CFLAGS="-Wall -Wno-attributes ${ARCH_CFLAGS} ${EXTRA_CFLAGS} ${CI_CFLAGS} -DSYS_xen -USYS_linux \
-fno-builtin-fprintf -DHAS_UNISTD -Werror=format \
-fno-builtin-fprintf -Werror=format \
$(pkg-config --cflags $PKG_CONFIG_DEPS) \
"

rm -rf ocaml-src
cp -r `ocamlfind query ocaml-src` ocaml-src
cp -r `opam config exec -- ocamlfind query ocaml-src` ocaml-src
chmod -R u+w ocaml-src

echo Detected OCaml version `ocamlopt -version`
case `ocamlopt -version` in
4.01.* | 4.02.[01])
echo Applying GC trace patch
patch < trace-gc.patch -p 0
;;
4.03.*)
echo Applying OCaml 4.03 config
cp config/version-403.h ocaml-src/byterun/caml/version.h
patch < clambda-warnings.patch -p 0
;;
4.04.*)
4.04.2)
echo Applying OCaml 4.04 config
cp config/version-404.h ocaml-src/byterun/caml/version.h
patch < clambda-warnings.patch -p 0
patch < os-type-xen.patch -p 0
BIGARRAY_OBJ="mmap_unix.o"
;;
4.05.*)
echo Applying OCaml 4.05 config
cp config/version-405.h ocaml-src/byterun/caml/version.h
BIGARRAY_OBJ=""
CFLAGS="-D__ANDROID__"
;;
*)
echo unsupported OCaml version `ocamlopt -version`
exit 1
;;
esac

cd ocaml-src && ./configure && cd ..
cp config/s.h ocaml-src/config/
cp config/m.${m_file}.h ocaml-src/config/m.h
cp config/Makefile.${m_file} ocaml-src/config/Makefile
touch ocaml-src/config/Makefile
cd ocaml-src
# cd byterun && make BYTECCCOMPOPTS="${CFLAGS}" BYTECCCOMPOPTS="${CFLAGS}" libcamlrun.a && cd ..
cd asmrun && make -j${NJOBS} UNIX_OR_WIN32=unix NATIVECCCOMPOPTS="-DNATIVE_CODE ${CFLAGS}" NATIVECCPROFOPTS="-DNATIVE_CODE ${CFLAGS}" libasmrun.a && cd ..
CFLAGS="$CFLAGS -I../../byterun"
cd otherlibs/bigarray && make CFLAGS="${CFLAGS}" bigarray_stubs.o mmap_unix.o && cd ../..
ar rcs libxenotherlibs.a otherlibs/bigarray/bigarray_stubs.o otherlibs/bigarray/mmap_unix.o
cd otherlibs/bigarray && make CFLAGS="${CFLAGS}" bigarray_stubs.o ${BIGARRAY_OBJ}
ar rcs ../../libxenotherlibs.a bigarray_stubs.o ${BIGARRAY_OBJ}
32 changes: 0 additions & 32 deletions xen-ocaml/clambda-warnings.patch

This file was deleted.

77 changes: 0 additions & 77 deletions xen-ocaml/config/Makefile.arm

This file was deleted.

77 changes: 0 additions & 77 deletions xen-ocaml/config/Makefile.x86_64

This file was deleted.

10 changes: 0 additions & 10 deletions xen-ocaml/config/m.arm.h

This file was deleted.

12 changes: 0 additions & 12 deletions xen-ocaml/config/m.x86_64.h

This file was deleted.

Loading

0 comments on commit 807616f

Please sign in to comment.