From f30a82d599eafddaf6859dbad007e8aac5543e6e Mon Sep 17 00:00:00 2001 From: Alexander Senier Date: Mon, 25 Feb 2019 12:39:37 +0100 Subject: [PATCH] ada: provide runtime symbols for elaboration code --- repos/libports/lib/import/import-spark.mk | 2 ++ repos/libports/lib/mk/spark.mk | 5 ++++- repos/libports/lib/symbols/spark | 18 ++++++++++++++++++ repos/libports/ports/ada-runtime.hash | 2 +- repos/libports/ports/ada-runtime.port | 2 +- repos/libports/src/test/spark/startup.cc | 5 +++++ .../libports/src/test/spark_exception/main.cc | 2 ++ .../src/test/spark_secondary_stack/main.cc | 4 ++++ 8 files changed, 37 insertions(+), 3 deletions(-) diff --git a/repos/libports/lib/import/import-spark.mk b/repos/libports/lib/import/import-spark.mk index ac2df4c980..1b8d8a7e38 100644 --- a/repos/libports/lib/import/import-spark.mk +++ b/repos/libports/lib/import/import-spark.mk @@ -3,10 +3,12 @@ ADA_RTS = $(BUILD_BASE_DIR)/var/libcache/spark ADA_RTS_SOURCE = $(call select_from_ports,ada-runtime)/ada-runtime/contrib/gcc-6.3.0 ADA_RUNTIME_DIR = $(call select_from_ports,ada-runtime)/ada-runtime/src/minimal 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) # Disable inline concatenation as this requires additinal runtime support diff --git a/repos/libports/lib/mk/spark.mk b/repos/libports/lib/mk/spark.mk index b87c92218b..3e11d342da 100644 --- a/repos/libports/lib/mk/spark.mk +++ b/repos/libports/lib/mk/spark.mk @@ -19,9 +19,10 @@ CUSTOM_ADA_FLAGS = --RTS=$(ADA_RTS) -c -gnatg -gnatp -gnatpg -gnatn2 # C runtime glue code SRC_CC += genode.cc +SRC_C += init.c # Ada packages that implement runtime functionality -SRC_ADB += ss_utils.adb string_utils.adb platform.adb +SRC_ADB += ss_utils.adb string_utils.adb platform.adb s-init.adb vpath %.cc $(ADA_RUNTIME_PLATFORM_DIR) @@ -41,5 +42,7 @@ 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 d8f32d498d..02e7a34e13 100644 --- a/repos/libports/lib/symbols/spark +++ b/repos/libports/lib/symbols/spark @@ -1,3 +1,19 @@ +__gl_default_stack_size D 4 +__gl_detect_blocking B 4 +__gl_exception_tracebacks B 4 +__gl_interrupt_states B 8 +__gl_leap_seconds_support B 4 +__gl_locking_policy D 1 +__gl_main_cpu D 4 +__gl_main_priority D 4 +__gl_num_interrupt_states B 4 +__gl_num_specific_dispatching B 4 +__gl_priority_specific_dispatching B 8 +__gl_queuing_policy D 1 +__gl_task_dispatching_policy D 1 +__gl_time_slice_val D 4 +__gl_unreserve_all_interrupts B 4 +__gl_wc_encoding D 1 __gnat_mulv64 T __gnat_raise_exception T __gnat_rcheck_CE_Discriminant_Check T @@ -10,6 +26,8 @@ __gnat_rcheck_CE_Overflow_Check T __gnat_rcheck_CE_Range_Check T __gnat_rcheck_PE_Explicit_Raise T __gnat_rcheck_SE_Explicit_Raise T +__gnat_runtime_finalize T +__gnat_runtime_initialize T ada__exceptions_E D 2 ada__exceptions__exception_dataIP T ada__exceptions__exception_occurrenceIP T diff --git a/repos/libports/ports/ada-runtime.hash b/repos/libports/ports/ada-runtime.hash index 4978d9603e..8b4e5319bd 100644 --- a/repos/libports/ports/ada-runtime.hash +++ b/repos/libports/ports/ada-runtime.hash @@ -1 +1 @@ -6fcdbbc50a6e5d2bc031f9191bd57854a27c5e09 +3306700040ccc016230b6fe4e9eae6949f0bb67a diff --git a/repos/libports/ports/ada-runtime.port b/repos/libports/ports/ada-runtime.port index a96135b89b..219e87efa6 100644 --- a/repos/libports/ports/ada-runtime.port +++ b/repos/libports/ports/ada-runtime.port @@ -3,7 +3,7 @@ VERSION := 0 DOWNLOADS := ada-runtime.git ada-runtime-alis.git URL(ada-runtime) := https://github.com/Componolit/ada-runtime.git -REV(ada-runtime) := 6a84715677e7538240360ee41a52912e6250dc8e +REV(ada-runtime) := 2f6b93c6b7b29db2e2d3f20c345f5b9801e82ee9 DIR(ada-runtime) := ada-runtime URL(ada-runtime-alis) := https://github.com/Componolit/ada-runtime-alis.git diff --git a/repos/libports/src/test/spark/startup.cc b/repos/libports/src/test/spark/startup.cc index 81210fd26b..b98c77dc40 100644 --- a/repos/libports/src/test/spark/startup.cc +++ b/repos/libports/src/test/spark/startup.cc @@ -30,6 +30,9 @@ extern "C" void __gnat_rcheck_CE_Overflow_Check() Genode::warning(__func__, " not implemented"); } +extern "C" void adainit(); +extern "C" void adafinal(); + /** * Wrapper for the Ada main program * @@ -39,9 +42,11 @@ extern "C" void __gnat_rcheck_CE_Overflow_Check() */ void Component::construct(Genode::Env &env) { + adainit(); _ada_main(); test_spark_object_construction(); + adafinal(); env.parent().exit(0); } diff --git a/repos/libports/src/test/spark_exception/main.cc b/repos/libports/src/test/spark_exception/main.cc index 06731e0fc2..33095fa999 100644 --- a/repos/libports/src/test/spark_exception/main.cc +++ b/repos/libports/src/test/spark_exception/main.cc @@ -18,9 +18,11 @@ #include extern "C" void except__raise_task(); +extern "C" void adainit(); void Component::construct(Genode::Env &env) { + adainit(); Genode::log("Ada exception test"); try { except__raise_task(); } diff --git a/repos/libports/src/test/spark_secondary_stack/main.cc b/repos/libports/src/test/spark_secondary_stack/main.cc index 9e55581a28..8878069c34 100644 --- a/repos/libports/src/test/spark_secondary_stack/main.cc +++ b/repos/libports/src/test/spark_secondary_stack/main.cc @@ -5,6 +5,8 @@ extern "C" void stack__calloc(int); extern "C" void stack__ralloc(); extern "C" void stack__salloc(); +extern "C" void adainit(); +extern "C" void adafinal(); extern "C" void print_stack(char* data) { @@ -28,6 +30,7 @@ extern "C" void __gnat_rcheck_CE_Overflow_Check() void Component::construct(Genode::Env &env) { + adainit(); Genode::log("running iteration test"); stack__calloc(32); stack__calloc(128); @@ -41,6 +44,7 @@ void Component::construct(Genode::Env &env) stack__salloc(); Genode::log("secondary stack test successful"); + adafinal(); env.parent().exit(0); }