diff --git a/repos/base/mk/prg.mk b/repos/base/mk/prg.mk
index bbb5f7f438..04caae01b2 100644
--- a/repos/base/mk/prg.mk
+++ b/repos/base/mk/prg.mk
@@ -106,7 +106,7 @@ $(SRC_ADA:.adb=.o): FORCE
#
ifneq ($(SRC_ADS)$(SRC_ADB),)
-CUSTOM_BINDER_FLAGS ?= -n -we
+CUSTOM_BINDER_FLAGS ?= -n -we -D768k
OBJECTS += b~$(TARGET).o
diff --git a/repos/gems/run/depot_autopilot.run b/repos/gems/run/depot_autopilot.run
index d2d572b29e..f77e383405 100644
--- a/repos/gems/run/depot_autopilot.run
+++ b/repos/gems/run/depot_autopilot.run
@@ -667,7 +667,6 @@ set default_test_pkgs {
test-fs_rom_update_fs
test-fs_rom_update_ram
test-fs_tool
- test-gnatio
test-init
test-init_loop
test-ldso
diff --git a/repos/libports/lib/import/import-spark.mk b/repos/libports/lib/import/import-spark.mk
index 52fd58ad7f..67c2a20108 100644
--- a/repos/libports/lib/import/import-spark.mk
+++ b/repos/libports/lib/import/import-spark.mk
@@ -6,10 +6,11 @@ ADA_RUNTIME_LIB_DIR = $(call select_from_ports,ada-runtime)/ada-runtime/src/lib
ADA_RUNTIME_COMMON_DIR = $(call select_from_ports,ada-runtime)/ada-runtime/src/common
ADA_RUNTIME_PLATFORM_DIR = $(call select_from_ports,ada-runtime)/ada-runtime/platform
-INC_DIR += $(ADA_RUNTIME_DIR)
-INC_DIR += $(ADA_RUNTIME_LIB_DIR)
-INC_DIR += $(ADA_RUNTIME_COMMON_DIR)
-INC_DIR += $(ADA_RTS_SOURCE)
+INC_DIR += $(ADA_RUNTIME_DIR) \
+ $(ADA_RUNTIME_LIB_DIR) \
+ $(ADA_RUNTIME_COMMON_DIR) \
+ $(ADA_RTS_SOURCE) \
+ $(ADA_RUNTIME_PLATFORM_DIR)
# Disable inline concatenation as this requires additinal runtime support
CC_ADA_OPT += -gnatd.c
diff --git a/repos/libports/lib/mk/spark.mk b/repos/libports/lib/mk/spark.mk
index 74bf6d01d2..5ebf351e1c 100644
--- a/repos/libports/lib/mk/spark.mk
+++ b/repos/libports/lib/mk/spark.mk
@@ -9,11 +9,9 @@ SRC_ADS += system.ads \
interfac.ads \
i-cexten.ads \
a-except.ads \
- gnat.ads \
- ada.ads \
- ada_exceptions.ads
+ ada.ads
-SRC_ADB += g-io.adb s-stalib.adb s-secsta.adb s-parame.adb i-c.adb s-arit64.adb s-stoele.adb
+SRC_ADB += s-stalib.adb s-secsta.adb s-parame.adb i-c.adb s-arit64.adb s-stoele.adb s-init.adb
CUSTOM_ADA_FLAGS = --RTS=$(ADA_RTS) -c -gnatg -gnatp -gnatpg -gnatn2
# C runtime glue code
@@ -21,9 +19,15 @@ SRC_CC += genode.cc
SRC_C += init.c
# Ada packages that implement runtime functionality
-SRC_ADB += ss_utils.adb string_utils.adb platform.adb s-init.adb
+SRC_ADS += componolit.ads \
+ componolit-runtime.ads \
+ componolit-runtime-exceptions.ads
+SRC_ADB += componolit-runtime-strings.adb \
+ componolit-runtime-debug.adb \
+ componolit-runtime-platform.adb \
+ componolit-runtime-conversions.adb
-vpath %.cc $(ADA_RUNTIME_PLATFORM_DIR)
+vpath %.cc $(ADA_RUNTIME_PLATFORM_DIR)/genode
vpath s-soflin.ads $(ADA_RUNTIME_DIR)
vpath a-except.ads $(ADA_RUNTIME_DIR)
@@ -34,15 +38,16 @@ vpath s-stalib.adb $(ADA_RUNTIME_DIR)
vpath s-parame.adb $(ADA_RUNTIME_DIR)
vpath a-except.adb $(ADA_RUNTIME_DIR)
vpath i-c.adb $(ADA_RUNTIME_DIR)
+vpath s-arit64.adb $(ADA_RUNTIME_DIR)
+vpath system.ads $(ADA_RUNTIME_DIR)
+vpath s-stoele.adb $(ADA_RUNTIME_DIR)
+vpath s-init.adb $(ADA_RUNTIME_DIR)
+
+vpath componolit% $(ADA_RUNTIME_LIB_DIR)
+vpath init.c $(ADA_RUNTIME_LIB_DIR)
+vpath s-init.adb $(ADA_RUNTIME_COMMON_DIR)
vpath %.ads $(ADA_RTS_SOURCE)
vpath %.adb $(ADA_RTS_SOURCE)
-vpath platform.% $(ADA_RUNTIME_LIB_DIR)
-vpath string_utils.% $(ADA_RUNTIME_LIB_DIR)
-vpath ss_utils.% $(ADA_RUNTIME_LIB_DIR)
-vpath ada_exceptions.ads $(ADA_RUNTIME_LIB_DIR)
-vpath init.c $(ADA_RUNTIME_LIB_DIR)
-vpath s-init.adb $(ADA_RUNTIME_COMMON_DIR)
-
SHARED_LIB = yes
diff --git a/repos/libports/lib/symbols/spark b/repos/libports/lib/symbols/spark
index 2bf468e3e9..b5ec16d3a2 100644
--- a/repos/libports/lib/symbols/spark
+++ b/repos/libports/lib/symbols/spark
@@ -15,7 +15,7 @@ __gl_time_slice_val D 4
__gl_unreserve_all_interrupts B 4
__gl_wc_encoding D 1
__gnat_binder_ss_count B 4
-__gnat_default_ss_pool B 4
+__gnat_default_ss_pool B 8
__gnat_default_ss_size B 4
__gnat_finalize T
__gnat_finalize_library_objects D 8
@@ -76,29 +76,51 @@ ada_exceptions__exception_typeA R 76
ada_exceptions__exception_typeN R 78
ada_exceptions__exception_typeRP T
ada_exceptions__exception_typeS R 820
-allocate_secondary_stack T
+componolit__runtime__debug_E D 2
+componolit__runtime__debug__log_debug T
+componolit__runtime__debug__log_debug_private T
+componolit__runtime__debug__log_error T
+componolit__runtime__debug__log_error_private T
+componolit__runtime__debug__log_warning T
+componolit__runtime__debug__log_warning_private T
+componolit__runtime__exceptions_E D 2
+componolit__runtime__exceptions__exception_typeA R 76
+componolit__runtime__exceptions__exception_typeN R 78
+componolit__runtime__exceptions__exception_typeRP T
+componolit__runtime__exceptions__exception_typeS R 820
+componolit__runtime__platform_E D 2
+componolit__runtime__platform__raise_ada_exception T
+componolit__runtime__secondary_stack_E D 2
+componolit__runtime__secondary_stack__TregistryBIP T
+componolit__runtime__secondary_stack___elabs T
+componolit__runtime__secondary_stack__allocate_stack T
+componolit__runtime__secondary_stack__c_alloc T
+componolit__runtime__secondary_stack__get_mark T
+componolit__runtime__secondary_stack__invalid_thread R 8
+componolit__runtime__secondary_stack__markIP T
+componolit__runtime__secondary_stack__null_registry B 3072
+componolit__runtime__secondary_stack__registry_entryIP T
+componolit__runtime__secondary_stack__s_allocate T
+componolit__runtime__secondary_stack__s_mark T
+componolit__runtime__secondary_stack__s_release T
+componolit__runtime__secondary_stack__secondary_stack_size R 8
+componolit__runtime__secondary_stack__set_mark T
+componolit__runtime__strings_E D 2
+componolit__runtime__strings__convert_to_ada T
+componolit__runtime__strings__get_char T
+componolit__runtime__strings__image T
+componolit__runtime__strings__incr T
+componolit__runtime__strings__length T
+componolit__runtime__strings__null_pointer R 8
+componolit__runtime__strings__to_address T
+componolit__runtime__strings__to_pointer T
+componolit_log_debug T
+componolit_log_error T
+componolit_log_warning T
+componolit_runtime_finalize T
+componolit_runtime_initialize T
+componolit_runtime_raise_ada_exception T
constraint_error D 40
-gnat_E D 2
-gnat__io_E D 2
-gnat__io__current_out D 1
-gnat__io__file_typeN R 4
-gnat__io__file_typeS R 16
-gnat__io__get T
-gnat__io__get__2 T
-gnat__io__get_line T
-gnat__io__new_line T
-gnat__io__new_line__2 T
-gnat__io__put T
-gnat__io__put__2 T
-gnat__io__put__3 T
-gnat__io__put__4 T
-gnat__io__put__5 T
-gnat__io__put__6 T
-gnat__io__put_line T
-gnat__io__put_line__2 T
-gnat__io__set_output T
-gnat__io__standard_error T
-gnat__io__standard_output T
interfaces_E D 2
interfaces__c_E D 2
interfaces__c__char16_arrayIP T
@@ -111,45 +133,7 @@ interfaces__c__extensions__signed_128IP T
interfaces__c__nul R 1
interfaces__c__wchar_arrayIP T
interfaces__c__wide_nul R 4
-log_debug T
-log_error T
-log_warning T
platform_E D 2
-platform__log_debug T
-platform__log_debug_private T
-platform__log_error T
-platform__log_error_private T
-platform__log_warning T
-platform__log_warning_private T
-platform__raise_ada_exception T
-put_char T
-put_char_stderr T
-put_int T
-put_int_stderr T
-raise_ada_exception T
-ss_utils_E D 2
-ss_utils__TregistryBIP T
-ss_utils___elabs T
-ss_utils__allocate_stack T
-ss_utils__c_alloc T
-ss_utils__get_mark T
-ss_utils__invalid_thread R 8
-ss_utils__markIP T
-ss_utils__null_registry B 3072
-ss_utils__registry_entryIP T
-ss_utils__s_allocate T
-ss_utils__s_mark T
-ss_utils__s_release T
-ss_utils__secondary_stack_size R 8
-ss_utils__set_mark T
-string_utils_E D 2
-string_utils__convert_to_ada T
-string_utils__get_char T
-string_utils__incr T
-string_utils__length T
-string_utils__null_pointer R 8
-string_utils__to_address T
-string_utils__to_pointer T
system__aamp R 1
system__always_compatible_rep R 1
system__arith_64__add_with_ovflo_check T
@@ -189,6 +173,7 @@ system__parameters__c_malloc_linkname R 16
system__parameters__runtime_default_sec_stack_size R 4
system__preallocated_stacks R 1
system__secondary_stack_E D 2
+system__secondary_stack___elabb T
system__secondary_stack___elabs T
system__secondary_stack__mark_idIP T
system__secondary_stack__memoryIP T
diff --git a/repos/libports/ports/ada-runtime.hash b/repos/libports/ports/ada-runtime.hash
index d1a229d606..cc9b873b6e 100644
--- a/repos/libports/ports/ada-runtime.hash
+++ b/repos/libports/ports/ada-runtime.hash
@@ -1 +1 @@
-4b6479e0bcbb8e5fc3210c20bea97045ce2f0002
+db898737bfc7439e637065a8f975097aad4741dc
diff --git a/repos/libports/ports/ada-runtime.port b/repos/libports/ports/ada-runtime.port
index 35200dbecd..098aaf4a92 100644
--- a/repos/libports/ports/ada-runtime.port
+++ b/repos/libports/ports/ada-runtime.port
@@ -3,9 +3,9 @@ VERSION := 0
DOWNLOADS := ada-runtime.git ada-runtime-alis.git
URL(ada-runtime) := https://github.com/Componolit/ada-runtime.git
-REV(ada-runtime) := 4660d7becf9d7112ae371fb678253d9b5798e3d1
+REV(ada-runtime) := e09f9981ad7e02407b1710b80b701384ef5c32f7
DIR(ada-runtime) := ada-runtime
URL(ada-runtime-alis) := https://github.com/Componolit/ada-runtime-alis.git
-REV(ada-runtime-alis) := d548a88f1e17ca1cdcf8f48238faf2563732cdd8
+REV(ada-runtime-alis) := a679a4097b416360efa9b37a4184479ce5adbae0
DIR(ada-runtime-alis) := ada-runtime-alis
diff --git a/repos/libports/recipes/api/spark/content.mk b/repos/libports/recipes/api/spark/content.mk
index f7cc229357..d4ab2e6a26 100644
--- a/repos/libports/recipes/api/spark/content.mk
+++ b/repos/libports/recipes/api/spark/content.mk
@@ -4,43 +4,48 @@ ADA_ALI_DIR := $(call port_dir,$(GENODE_DIR)/repos/libports/ports/ada-runtime)/a
MIRROR_FROM_ADA_RT_DIR := \
$(addprefix ada-runtime/contrib/gcc-8.3.0/,\
ada.ads \
- system.ads \
- s-stoele.ads \
a-unccon.ads \
- gnat.ads \
- g-io.ads \
interfac.ads \
i-cexten.ads \
- s-arit64.ads \
+ s-maccod.ads \
s-unstyp.ads \
) \
$(addprefix ada-runtime/src/minimal/,\
- s-stalib.ads \
a-except.ads \
- s-secsta.ads \
- s-parame.ads \
- s-soflin.ads \
- s-exctab.ads \
i-c.ads \
+ system.ads \
+ s-arit64.ads \
+ s-exctab.ads \
+ s-parame.ads \
+ s-secsta.ads \
+ s-soflin.ads \
+ s-stalib.ads \
+ s-stoele.ads \
) \
$(addprefix ada-runtime/src/lib/,\
- ss_utils.ads \
- string_utils.ads \
- platform.ads \
- ada_exceptions.ads \
- ada_exceptions.h \
- )
+ componolit.ads \
+ componolit-runtime.ads \
+ componolit-runtime-conversions.ads \
+ componolit-runtime-debug.ads \
+ componolit-runtime-exceptions.ads \
+ componolit-runtime-platform.ads \
+ componolit-runtime-strings.ads \
+ ) \
+ ada-runtime/src/common/s-init.ads
MIRROR_FROM_ADA_ALI_DIR := \
+ a-except.ali \
ada.ali \
- ada_exceptions.ali \
- a-except.ali \
- g-io.ali \
- gnat.ali \
- interfac.ali \
+ componolit-runtime-conversions.ali \
+ componolit-runtime-debug.ali \
+ componolit-runtime-exceptions.ali \
+ componolit-runtime-platform.ali \
+ componolit-runtime-strings.ali \
+ componolit-runtime.ali \
+ componolit.ali \
i-c.ali \
i-cexten.ali \
- platform.ali \
+ interfac.ali \
s-arit64.ali \
s-init.ali \
s-parame.ali \
@@ -49,9 +54,7 @@ MIRROR_FROM_ADA_ALI_DIR := \
s-stalib.ali \
s-stoele.ali \
s-unstyp.ali \
- ss_utils.ali \
- string_utils.ali \
- system.ali \
+ system.ali
content: $(MIRROR_FROM_ADA_RT_DIR) $(MIRROR_FROM_ADA_ALI_DIR)
diff --git a/repos/libports/recipes/pkg/test-gnatio/README b/repos/libports/recipes/pkg/test-gnatio/README
deleted file mode 100644
index c02a79c4f4..0000000000
--- a/repos/libports/recipes/pkg/test-gnatio/README
+++ /dev/null
@@ -1 +0,0 @@
-Test for the GNAT.IO support of the Ada runtime.
diff --git a/repos/libports/recipes/pkg/test-gnatio/archives b/repos/libports/recipes/pkg/test-gnatio/archives
deleted file mode 100644
index de85ebc81e..0000000000
--- a/repos/libports/recipes/pkg/test-gnatio/archives
+++ /dev/null
@@ -1,4 +0,0 @@
-_/src/init
-_/src/test-gnatio
-_/src/spark
-_/src/log_terminal
diff --git a/repos/libports/recipes/pkg/test-gnatio/hash b/repos/libports/recipes/pkg/test-gnatio/hash
deleted file mode 100644
index 3f51138f54..0000000000
--- a/repos/libports/recipes/pkg/test-gnatio/hash
+++ /dev/null
@@ -1 +0,0 @@
-2019-07-08 9b8a04ad6a71621edd81e6437061214a1fa9715d
diff --git a/repos/libports/recipes/pkg/test-gnatio/runtime b/repos/libports/recipes/pkg/test-gnatio/runtime
deleted file mode 100644
index 41c3f71a7a..0000000000
--- a/repos/libports/recipes/pkg/test-gnatio/runtime
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- GNAT.IO test program started successfully.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/repos/libports/recipes/src/spark/content.mk b/repos/libports/recipes/src/spark/content.mk
index 158492353f..4454dab5f3 100644
--- a/repos/libports/recipes/src/spark/content.mk
+++ b/repos/libports/recipes/src/spark/content.mk
@@ -3,36 +3,53 @@ ADA_RT_DIR := $(call port_dir,$(GENODE_DIR)/repos/libports/ports/ada-runtime)
MIRROR_FROM_ADA_RT_DIR := \
$(addprefix ada-runtime/contrib/gcc-8.3.0/,\
ada.ads \
- system.ads \
- interfac.ads \
- s-unstyp.ads \
- s-stoele.ads \
- s-stoele.adb \
a-unccon.ads \
+ interfac.ads \
+ i-cexten.ads \
+ s-maccod.ads \
+ s-unstyp.ads \
+ ) \
+ $(addprefix ada-runtime/src/minimal/,\
+ a-except.ads \
+ a-except.adb \
+ i-c.ads \
+ i-c.adb \
+ system.ads \
s-arit64.ads \
s-arit64.adb \
- gnat.ads \
- g-io.ads \
- g-io.adb \
- i-cexten.ads \
+ s-exctab.ads \
+ s-exctab.adb \
+ s-parame.ads \
+ s-parame.adb \
+ s-secsta.ads \
+ s-secsta.adb \
+ s-soflin.ads \
+ s-soflin.adb \
+ s-stalib.ads \
+ s-stalib.adb \
+ s-stoele.ads \
+ s-stoele.adb \
) \
$(addprefix ada-runtime/src/lib/,\
- ada_exceptions.ads \
- ada_exceptions.h \
- argv.c \
- exit.c \
+ componolit.ads \
+ componolit-runtime.ads \
+ componolit-runtime-conversions.ads \
+ componolit-runtime-conversions.adb \
+ componolit-runtime-debug.ads \
+ componolit-runtime-debug.adb \
+ componolit-runtime-exceptions.ads \
+ componolit-runtime-platform.ads \
+ componolit-runtime-platform.adb \
+ componolit-runtime-strings.ads \
+ componolit-runtime-strings.adb \
init.c \
- platform.ads \
- platform.adb \
- ss_utils.ads \
- ss_utils.adb \
- string_utils.ads \
- string_utils.adb \
) \
- ada-runtime/src/common \
- ada-runtime/src/minimal \
- ada-runtime/platform/genode.cc \
- ada-runtime/platform/unwind.h
+ ada-runtime/src/common/s-init.ads \
+ ada-runtime/src/common/s-init.adb \
+ ada-runtime/platform/genode/genode.cc \
+ ada-runtime/platform/componolit_runtime.h \
+ ada-runtime/platform/ada_exceptions.h \
+ ada-runtime/platform/gnat_helpers.h
content: $(MIRROR_FROM_ADA_RT_DIR)
diff --git a/repos/libports/recipes/src/test-gnatio/content.mk b/repos/libports/recipes/src/test-gnatio/content.mk
deleted file mode 100644
index 2fcbb37dd3..0000000000
--- a/repos/libports/recipes/src/test-gnatio/content.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-SRC_DIR = src/test/gnatio
-
-include $(GENODE_DIR)/repos/base/recipes/src/content.inc
diff --git a/repos/libports/recipes/src/test-gnatio/hash b/repos/libports/recipes/src/test-gnatio/hash
deleted file mode 100644
index 8ffc741975..0000000000
--- a/repos/libports/recipes/src/test-gnatio/hash
+++ /dev/null
@@ -1 +0,0 @@
-2019-07-08 39623ef76139921c1ece41ec937b023944a5139b
diff --git a/repos/libports/recipes/src/test-gnatio/used_apis b/repos/libports/recipes/src/test-gnatio/used_apis
deleted file mode 100644
index 1c8e7eedfb..0000000000
--- a/repos/libports/recipes/src/test-gnatio/used_apis
+++ /dev/null
@@ -1,3 +0,0 @@
-base
-spark
-terminal_session
diff --git a/repos/libports/src/test/gnatio/main.adb b/repos/libports/src/test/gnatio/main.adb
deleted file mode 100644
index 23c3ed76b1..0000000000
--- a/repos/libports/src/test/gnatio/main.adb
+++ /dev/null
@@ -1,36 +0,0 @@
---
--- \brief GNAT.IO test program
--- \author Alexander Senier
--- \date 2019-01-03
---
-
-with GNAT.IO;
-
-procedure Main is
- use GNAT.IO;
-begin
- Put (Standard_Output, "Hell");
- Put (Standard_Output, 'o');
- Put_Line (Standard_Output, " World!");
- New_Line (Standard_Output);
- Put (Standard_Output, 98765432);
- New_Line;
-
- Put ("Integer: ");
- Put (123456);
- New_Line;
-
- Put_Line ("Character: ");
- Put ('X');
- Put ('Y');
- Put ('Z');
- New_Line;
-
- Put ("New_Line with spacing:");
- New_Line (Spacing => 5);
-
- Set_Output (Standard_Error);
- Put (11223344);
- New_Line;
- Put_Line ("GNAT.IO test program started successfully.");
-end Main;
diff --git a/repos/libports/src/test/gnatio/startup.cc b/repos/libports/src/test/gnatio/startup.cc
deleted file mode 100644
index 7dd6925ba3..0000000000
--- a/repos/libports/src/test/gnatio/startup.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * \brief Wrapper for Ada main program using Terminal session
- * \author Alexander Senier
- * \date 2019-01-03
- */
-
-/* Genode includes */
-#include
-#include
-
-extern "C" void _ada_main(void);
-
-/* Required in runtime */
-Terminal::Connection *__genode_terminal;
-
-void Component::construct(Genode::Env &env)
-{
- Terminal::Connection _terminal (env, "Ada");
- __genode_terminal = &_terminal;
-
- _ada_main();
- env.parent().exit(0);
-}
diff --git a/repos/libports/src/test/gnatio/target.mk b/repos/libports/src/test/gnatio/target.mk
deleted file mode 100644
index f9811ba122..0000000000
--- a/repos/libports/src/test/gnatio/target.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET = test-gnatio
-SRC_ADB = main.adb
-SRC_CC = startup.cc
-LIBS = base spark