Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
449 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# opam-rumprun | ||
|
||
OCaml 4.02 toolchain for [rumprun](http://repo.rumpkernel.org/rumprun). | ||
|
||
Based on/inspired by the Android toolchain by @whitequark, | ||
https://github.com/whitequark/opam-android. | ||
|
||
*Experimental work in progress*, currently hardcoded to use the `rumprun-xen` | ||
toolchain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
OCaml cross-compiler for the Rumprun unikernel stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Generated by running "./configure -no-curses -no-shared-libs" on a | ||
# NetBSD 7-HEAD system, adding substitutions and pointing to | ||
# rumprun compiler. | ||
# N.B.: threads and dynlink must be removed from OTHERLIBRARIES, | ||
# debugger, doc and ocamlbuild must be disabled for the build | ||
# to complete. | ||
PREFIX=%{prefix}%/x86_64-rumprun-netbsd | ||
BINDIR=$(PREFIX)/bin | ||
LIBDIR=$(PREFIX)/lib/ocaml | ||
STUBLIBDIR=$(LIBDIR)/stublibs | ||
MANDIR=$(PREFIX)/man | ||
MANEXT=1 | ||
CAMLRUN=ocamlrun | ||
CAMLYACC=ocamlyacc | ||
RANLIB=ranlib | ||
RANLIBCMD=ranlib | ||
ARCMD=ar | ||
SHARPBANGSCRIPTS=true | ||
UNIX_OR_WIN32=unix | ||
UNIXLIB=unix | ||
GRAPHLIB=graph | ||
BNG_ARCH=amd64 | ||
BNG_ASM_LEVEL=1 | ||
PTHREAD_LINK=-lpthread | ||
PTHREAD_CAML_LINK=-cclib -lpthread | ||
X11_INCLUDES=not found | ||
X11_LINK=not found | ||
LIBBFD_LINK= | ||
BYTECC=rumprun-xen-cc | ||
BYTECCCOMPOPTS=-fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT | ||
BYTECCLINKOPTS= | ||
BYTECCLIBS= -lm -lpthread | ||
BYTECCRPATH= | ||
EXE= | ||
SUPPORTS_SHARED_LIBRARIES=false | ||
SHAREDCCCOMPOPTS= | ||
MKSHAREDLIBRPATH= | ||
NATDYNLINKOPTS= | ||
SYSLIB=-l$(1) | ||
#ml let syslib x = "-l"^x;; | ||
|
||
### How to build a static library | ||
MKLIB=ar rc $(1) $(2); ranlib $(1) | ||
#ml let mklib out files opts = Printf.sprintf "ar rc %s %s %s; ranlib %s" out opts files out;; | ||
ARCH=amd64 | ||
MODEL=default | ||
SYSTEM=netbsd | ||
NATIVECC=rumprun-xen-cc | ||
NATIVECCCOMPOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT | ||
NATIVECCPROFOPTS=-Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT | ||
NATIVECCLINKOPTS= | ||
NATIVECCRPATH= | ||
NATIVECCLIBS= -lm | ||
ASM=as | ||
ASPP=rumprun-xen-cc -c | ||
ASPPPROFFLAGS=-DPROFILING | ||
PROFILING=noprof | ||
DYNLINKOPTS= | ||
OTHERLIBRARIES=unix str num bigarray systhreads | ||
CC_PROFILE=-pg | ||
SYSTHREAD_SUPPORT=true | ||
PARTIALLD=ld -r | ||
PACKLD=$(PARTIALLD) $(NATIVECCLINKOPTS) -o\ | ||
DLLCCCOMPOPTS= | ||
IFLEXDIR= | ||
O=o | ||
A=a | ||
SO=so | ||
EXT_OBJ=.o | ||
EXT_ASM=.s | ||
EXT_LIB=.a | ||
EXT_DLL=.so | ||
EXTRALIBS= | ||
CCOMPTYPE=cc | ||
TOOLCHAIN=cc | ||
NATDYNLINK=false | ||
CMXS=cmxa | ||
MKEXE=$(BYTECC) | ||
MKEXEDEBUGFLAG=-g | ||
MKDLL= | ||
MKMAINDLL= | ||
RUNTIMED=noruntimed | ||
WITH_DEBUGGER= | ||
WITH_OCAMLDOC= | ||
WITH_OCAMLBUILD= | ||
ASM_CFI_SUPPORTED=true | ||
WITH_FRAME_POINTERS=false | ||
TARGET=x86_64-rumprun-netbsd7.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#define ARCH_SIXTYFOUR | ||
#define SIZEOF_INT 4 | ||
#define SIZEOF_LONG 8 | ||
#define SIZEOF_PTR 8 | ||
#define SIZEOF_SHORT 2 | ||
#define SIZEOF_LONGLONG 8 | ||
#undef ARCH_BIG_ENDIAN | ||
#undef ARCH_ALIGN_DOUBLE | ||
#undef ARCH_ALIGN_INT64 | ||
#undef NONSTANDARD_DIV_MOD | ||
#define ASM_CFI_SUPPORTED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#define OCAML_OS_TYPE "Unix" | ||
#define OCAML_STDLIB_DIR "." | ||
#define POSIX_SIGNALS | ||
#define HAS_C99_FLOAT_OPS | ||
#define HAS_GETRUSAGE | ||
#define HAS_TIMES | ||
#define HAS_SOCKETS | ||
#define HAS_SOCKLEN_T | ||
#define HAS_INET_ATON | ||
#define HAS_IPV6 | ||
#define HAS_UNISTD | ||
#define HAS_OFF_T | ||
#define HAS_DIRENT | ||
#define HAS_REWINDDIR | ||
#define HAS_LOCKF | ||
#define HAS_MKFIFO | ||
#define HAS_GETCWD | ||
#define HAS_GETWD | ||
#define HAS_GETPRIORITY | ||
#define HAS_UTIME | ||
#define HAS_UTIMES | ||
#define HAS_DUP2 | ||
#define HAS_FCHMOD | ||
#define HAS_TRUNCATE | ||
#define HAS_SYS_SELECT_H | ||
#define HAS_SELECT | ||
#define HAS_SYMLINK | ||
#define HAS_WAITPID | ||
#define HAS_WAIT4 | ||
#define HAS_GETGROUPS | ||
#define HAS_SETGROUPS | ||
#define HAS_INITGROUPS | ||
#define HAS_TERMIOS | ||
#define HAS_ASYNC_IO | ||
#define HAS_SETITIMER | ||
#define HAS_GETHOSTNAME | ||
#define HAS_UNAME | ||
#define HAS_GETTIMEOFDAY | ||
#define HAS_MKTIME | ||
#define HAS_SETSID | ||
#define HAS_PUTENV | ||
#define HAS_LOCALE | ||
#define HAS_MMAP | ||
#define HAS_PWRITE | ||
#define HAS_GETHOSTBYNAME_R 5 | ||
#define HAS_GETHOSTBYADDR_R 7 | ||
#define HAS_MKSTEMP | ||
#define HAS_NICE | ||
#define HAS_SIGWAIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh -e | ||
set -x | ||
PREFIX="$1" | ||
|
||
# Replace bytecode interpreter with current runtime path. | ||
# XXX: Unclear why the original code does not work. | ||
for bin in ${PREFIX}/x86_64-rumprun-netbsd/bin/*; do | ||
sed -i "s%^.*ocamlrun$%#\!$(which ocamlrun)%" $bin | ||
done | ||
|
||
for pkg in bigarray bytes compiler-libs dynlink findlib graphics num num-top ocamlbuild stdlib str threads unix; do | ||
cp -r "${PREFIX}/lib/${pkg}" "${PREFIX}/x86_64-rumprun-netbsd/lib/" | ||
done | ||
|
||
mkdir -p "${PREFIX}/lib/findlib.conf.d" | ||
cp rumprun.conf "${PREFIX}/lib/findlib.conf.d" |
Oops, something went wrong.