diff --git a/.gitmodules b/.gitmodules index df264e33c..263694b95 100644 --- a/.gitmodules +++ b/.gitmodules @@ -106,3 +106,6 @@ [submodule "libretro/cores/yabause/upstream"] path = libretro/cores/yabause/upstream url = https://github.com/libretro/yabause.git +[submodule "solo5/upstream"] + path = solo5/upstream + url = https://github.com/Solo5/solo5.git diff --git a/solo5/Tupfile b/solo5/Tupfile new file mode 100644 index 000000000..d778ecb5a --- /dev/null +++ b/solo5/Tupfile @@ -0,0 +1,32 @@ +TARGET_NAME = solo5 +LIBS += genode-os +include_rules + +: solo5.symbols |> !abi_stub |> + +: solo5.pc.in |> ^ SED %B^ \ + sed \ + -e "s|@includedir@|`nix-store --add upstream/include`|" \ + -e "s|@version@|`git describe`|" \ + < %f > %o \ +|> $(PKG_CONFIG_DIR)/solo5.pc $(GENODE_DIR)/ + +: |> cc -Iupstream/include/solo5 upstream/%o/%o.c -o %o |> mfttool + +DEFINES += -D__SOLO5_BINDINGS__ +CXXFLAGS += -Drestrict=__restrict__ + +DEFINES += -Wno-builtin-declaration-mismatch + +INCLUDES += -Iupstream/include/solo5 +INCLUDES += -Iupstream/include/crt + +#: foreach ../../tenders/common/mft.c |> !cc |> {obj} + +BINDINGS_DIR = upstream/bindings/genode + +: foreach $(BINDINGS_DIR)/*.cc |> !cxx |> {obj} +: {obj} |> !lib |> solo5.lib.so {bin} +: {bin} |> !collect_bin |> + +include &(BIN_RULES) diff --git a/solo5/Tuprules.tup b/solo5/Tuprules.tup new file mode 100644 index 000000000..dd81b6888 --- /dev/null +++ b/solo5/Tuprules.tup @@ -0,0 +1,2 @@ +DEFINES += -Wno-builtin-declaration-mismatch +INCLUDES += -I$(TUP_CWD) diff --git a/solo5/solo5.pc.in b/solo5/solo5.pc.in new file mode 100644 index 000000000..73413f64a --- /dev/null +++ b/solo5/solo5.pc.in @@ -0,0 +1,7 @@ +includedir=@includedir@ + +Name: solo5 +Version: @version@ +Description: Solo5 sandboxed execution environment +Cflags: -I${includedir}/crt -I${includedir}/solo5 +Libs: -l:solo5.lib.so diff --git a/solo5/solo5.symbols b/solo5/solo5.symbols new file mode 100644 index 000000000..10c8231d5 --- /dev/null +++ b/solo5/solo5.symbols @@ -0,0 +1,15 @@ +solo5_abort T +solo5_block_acquire T +solo5_block_info T +solo5_block_read T +solo5_block_write T +solo5_clock_monotonic T +solo5_clock_wall T +solo5_console_write T +solo5_exit T +solo5_net_acquire T +solo5_net_info T +solo5_net_read T +solo5_net_write T +solo5_set_tls_base T +solo5_yield T diff --git a/solo5/stdint.h b/solo5/stdint.h new file mode 100644 index 000000000..5b2a13921 --- /dev/null +++ b/solo5/stdint.h @@ -0,0 +1,12 @@ +// Genode stdint.h +#include + +typedef genode_int8_t int8_t; +typedef genode_uint8_t uint8_t; +typedef genode_int16_t int16_t; +typedef genode_uint16_t uint16_t; +typedef genode_int32_t int32_t; +typedef genode_uint32_t uint32_t; +typedef genode_int64_t int64_t; +typedef genode_uint64_t uint64_t; +typedef unsigned long uintptr_t; diff --git a/solo5/test/Tupfile b/solo5/test/Tupfile new file mode 100644 index 000000000..ada174b13 --- /dev/null +++ b/solo5/test/Tupfile @@ -0,0 +1,34 @@ +TARGET_NAME = solo5_tests +LIBS += solo5 genode-base + +PKG_DEPENDS += \ + _/src/init \ + _/src/nic_loopback \ + _/src/ram_block \ + _/src/sequence \ + _/src/solo5 \ + _/src/$(BIN_NAME) \ + +include_rules + +run ./test_rules.sh \ + blk \ + dumpcore \ + exception \ + fpu \ + globals \ + hello \ + net \ + net_2if \ + notls \ + quiet \ + ssp \ + time \ + wnox \ + xnow \ + +: foreach {bin} |> !collect_bin |> +: runtime |> !collect_pkg_runtime |> + +include &(BIN_RULES) +include &(PKG_RULES) diff --git a/solo5/test/runtime b/solo5/test/runtime new file mode 100644 index 000000000..4cd928433 --- /dev/null +++ b/solo5/test/runtime @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solo5/test/test_rules.sh b/solo5/test/test_rules.sh new file mode 100755 index 000000000..1a80ced56 --- /dev/null +++ b/solo5/test/test_rules.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for T in ${@} +do + echo ": foreach ../upstream/tests/test_${T}/*.c |> !cc |> ${T}_%B.o {${T}-obj}" + echo ": {${T}-obj} |> !prg |> test_${T} {bin}" +done diff --git a/solo5/upstream b/solo5/upstream new file mode 160000 index 000000000..d0ca2cb1b --- /dev/null +++ b/solo5/upstream @@ -0,0 +1 @@ +Subproject commit d0ca2cb1bf77c9467b2ade2269322dc3ec23863c