From cdfb1ff60822a2157ad577ad8b116e42abc1ba81 Mon Sep 17 00:00:00 2001 From: Johannes Kliemann Date: Mon, 12 Aug 2024 14:39:56 +0000 Subject: [PATCH] Add Linux source profile To properly support light-tasking on Linux a separate source profile for Linux is required. This change introduces the new profile and adapts the current Linux light runtime to use it. ref eng/toolchain/bb-runtimes#77 --- gen_rts_sources.py | 2 +- native/__init__.py | 2 +- support/rts_sources/sources.py | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/gen_rts_sources.py b/gen_rts_sources.py index 7780ffd9..7f0e5536 100755 --- a/gen_rts_sources.py +++ b/gen_rts_sources.py @@ -48,7 +48,7 @@ def main(): ) parser.add_argument( "--source-profile", - choices=["bb", "deos", "freertos", "pikeos", "vx7r2cert", "qnx"], + choices=["bb", "deos", "freertos", "linux", "pikeos", "vx7r2cert", "qnx"], default="bb", help="platform specific source selections", ) diff --git a/native/__init__.py b/native/__init__.py index 8adeab1f..80f0b879 100644 --- a/native/__init__.py +++ b/native/__init__.py @@ -4,7 +4,7 @@ class Native(DFBBTarget): def __init__(self): super().__init__() - self.add_gnat_sources("src/s-macres__native.adb", "src/s-textio__stdio.adb") + self.add_gnat_sources("src/s-macres__native.adb") @property def target(self): diff --git a/support/rts_sources/sources.py b/support/rts_sources/sources.py index 7e786d80..4238d565 100644 --- a/support/rts_sources/sources.py +++ b/support/rts_sources/sources.py @@ -284,6 +284,16 @@ "hie/g-io__zfp.adb", "hie/g-io-put.adb", ], + "linux_srcs": [ + "hie/a-textio.ads", + "hie/a-textio__libc.adb", + "hie/g-io__zfp.ads", + "hie/g-io__zfp.adb", + "hie/g-io-put.adb", + "hie/s-macres.ads", + "hie/s-textio__libc.ads", + "hie/s-textio__libc.adb", + ], "pikeos_srcs": [ "hie/a-textio.ads", "exit.c", @@ -312,10 +322,10 @@ "hie/g-io__zfp.adb", "hie/g-io-put.adb", "hie/a-textio.ads", - "hie/a-textio__qnx.adb", + "hie/a-textio__libc.adb", "hie/s-macres.ads", - "hie/s-textio__qnx.ads", - "hie/s-textio__qnx.adb", + "hie/s-textio__libc.ads", + "hie/s-textio__libc.adb", ], }, "common/32": { @@ -352,6 +362,7 @@ ], "bb_srcs": ["hie/a-elchha__zfp.adb"], "freertos_srcs": ["hie/a-elchha__zfp.adb"], + "linux_srcs": ["hie/a-elchha__zfp.adb"], "pikeos_srcs": ["hie/a-elchha__zfp.adb"], "qnx_srcs": [ "hie/a-elchha__traceback.adb", @@ -381,6 +392,7 @@ "bb_srcs": ["hie/s-sssita.ads", "hie/s-sssita.adb"], "deos_srcs": ["hie/s-thread__cert.ads", "hie/s-thread__cert.adb"], "freertos_srcs": ["hie/s-sssita.ads", "hie/s-sssita.adb"], + "linux_srcs": ["hie/s-sssita.ads", "hie/s-sssita.adb"], "pikeos_srcs": [ "hie/a-textio__pikeos-light.adb", "hie/s-sssita.ads", @@ -1357,6 +1369,19 @@ "hie/s-libm__ada.adb", "hie/s-libpre__ada.ads", ], + "linux_srcs": [ + "hie/a-ngelfu__cert.ads", + "hie/a-ngelfu__cert.adb", + "hie/a-nlelfu__cert.ads", + "hie/a-nuelfu__cert.ads", + "hie/s-gcmain__cert.ads", + "hie/s-gcmain__cert.adb", + "hie/a-nllefu__cert.ads", + "hie/a-nuaufl__light.ads", + "hie/a-nalofl__light.ads", + "hie/a-nallfl__light.ads", + "libgnat/a-naliop.ads", + ], "pikeos_srcs": [ "hie/a-ngelfu__ada.ads", "hie/a-ngelfu__ada.adb", @@ -2224,16 +2249,19 @@ "conditions": ["RTS_Profile:light", "Memory_Profile:small"], "bb_srcs": ["hie/s-parame__zfp_small.ads"], "freertos_srcs": ["hie/s-parame__zfp_small.ads"], + "linux_srcs": ["hie/s-parame__zfp_small.ads"], }, "gnat/parameters/light-large": { "conditions": ["RTS_Profile:light", "Memory_Profile:large"], "bb_srcs": ["hie/s-parame__zfp.ads"], "freertos_srcs": ["hie/s-parame__zfp.ads"], + "linux_srcs": ["hie/s-parame__zfp.ads"], }, "gnat/parameters/light-huge": { "conditions": ["RTS_Profile:light", "Memory_Profile:huge"], "bb_srcs": ["hie/s-parame__zfp_huge.ads"], "freertos_srcs": ["hie/s-parame__zfp_huge.ads"], + "linux_srcs": ["hie/s-parame__zfp_huge.ads"], }, # Cert "cert": {