Skip to content

Commit

Permalink
Merge branch 'work/command-line-support-for-light' into '24.1'
Browse files Browse the repository at this point in the history
Add Ada.Command_Line support to VxWorks, QNX and Deos targets

See merge request eng/toolchain/bb-runtimes!59
  • Loading branch information
burratoo committed Nov 28, 2023
2 parents 7e741e3 + af5363e commit 6d3fccc
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 9 deletions.
4 changes: 4 additions & 0 deletions deos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def __init__(self):
super(Deos, self).__init__()
self.add_gnat_sources("src/s-macres__deos.adb")

@property
def has_command_line_arguments(self):
return True

@property
def has_single_precision_fpu(self):
return True
Expand Down
4 changes: 4 additions & 0 deletions pikeos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@


class PikeOS(Target):
@property
def has_command_line_arguments(self):
return True

@property
def has_double_precision_fpu(self):
return True
Expand Down
5 changes: 4 additions & 1 deletion qnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ def __init__(self):
super(QNX, self).__init__()
self.add_gnat_sources('src/s-macres__qnx.adb')

@property
def has_command_line_arguments(self):
return True

def has_libc(self, profile):
return True

Expand All @@ -25,7 +29,6 @@ def is_legacy_format(self):
def use_certifiable_packages(self):
return True


class Aarch64QNX(QNX):
def __init__(self):
super(Aarch64QNX, self).__init__()
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-deos-arm-light.ads
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-qnx-arm-light-tasking.ads
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-qnx-arm-light.ads
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-vxworks7-arm-ravenscar-sfp-rtp.ads
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-vxworks7-ppc-ravenscar-sfp-rtp.ads
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-vxworks7-ppc64-ravenscar-sfp-rtp.ads
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
2 changes: 1 addition & 1 deletion src/system/system-vxworks7-x86-ravenscar-sfp-rtp.ads
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private

Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := True;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Expand Down
7 changes: 6 additions & 1 deletion support/bsp_sources/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def has_timer_64(self):
"""
return False

@property
def has_command_line_arguments(self):
"""True if the OS supports command line arguments"""
return False

@property
def has_compare_and_swap(self):
"""True if the hardware supports an atomic compare-and-swap function.
Expand Down Expand Up @@ -162,7 +167,7 @@ def __init__(self):
'-fdata-sections'],
'common_gnarl_flags': [],
'asm_flags': [],
'c_flags': ['-DIN_RTS', '-Dinhibit_libc']}
'c_flags': ['-DIN_RTS', '-Dinhibit_libc', '-DLIGHT_RUNTIME']}
# GNAT-LLVM doesn't support -fcallgraph-info
if target_compiler() != Compiler.gnat_llvm:
self.build_flags['common_flags'].append('-fcallgraph-info=su,da')
Expand Down
5 changes: 5 additions & 0 deletions support/rts_sources/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ def light_scenarios(self, profile='light'):
else:
ret['Has_FPU'] = 'no'

if self.config.has_command_line_arguments:
ret['Add_Command_Line'] = 'yes'
else:
ret['Add_Command_Line'] = 'no'

if self.config.has_libc(profile):
ret['Has_libc'] = 'yes'
else:
Expand Down
14 changes: 14 additions & 0 deletions support/rts_sources/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
'Add_Pack64': ['no', 'yes'],
# Various support packages
'Add_Case_Util': ['no', 'yes'],
'Add_Command_Line': ['no', 'yes'],
'Add_Float_Util': ['no', 'yes'],
'Add_Image_Util': ['no', 'yes'],
'Add_IO_Exceptions': ['no', 'yes'],
Expand Down Expand Up @@ -223,24 +224,28 @@
'hie/s-macres.ads',
'hie/s-textio.ads'],
'deos_srcs': [
'exit.c',
'hie/g-io__c.ads',
'hie/a-textio__deos.ads', 'hie/a-textio__deos.adb',
'hie/s-macres.ads',
],
'pikeos_srcs': [
'hie/a-textio.ads',
'exit.c',
'hie/g-io__zfp.ads', 'hie/g-io__zfp.adb',
'hie/g-io-put__bb.adb',
'hie/s-macres.ads',
'hie/s-parame__large.ads', 'hie/s-parame.adb',
'hie/s-textio.ads'],
'vx7r2cert_srcs': [
'exit.c',
'libgnat/g-io.ads', 'hie/g-io__vxworks7cert.adb',
'hie/s-textio__vxworks7cert.ads', 'hie/s-textio__vxworks7cert.adb',
'hie/a-textio.ads', 'hie/a-textio__vxworks7cert.adb',
'hie/s-macres.ads',
'vx_stack_info.c'],
'qnx_srcs': [
'exit.c',
'hie/g-io__zfp.ads', 'hie/g-io__zfp.adb',
'hie/g-io-put.adb',
'hie/a-textio.ads', 'hie/a-textio__qnx.adb',
Expand Down Expand Up @@ -354,6 +359,15 @@
'libgnat/s-parame__qnx.adb',
'hie/s-init__light.ads']
},

# Command Line
'command_line': {
'conditions': ['Add_Command_Line:yes'],
'srcs': ['libgnat/a-comlin.ads', 'libgnat/a-comlin.adb',
'argv.c',
'runtime.h']
},

'gccmath': {
'conditions': ['RTS_Profile:light,light-tasking', 'Target_Word_Size:64'],
'srcs': [],
Expand Down
4 changes: 4 additions & 0 deletions vx7r2cert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def __init__(self, is_rtp):
super(Vx7r2Cert, self).__init__()
self.add_gnat_sources('src/s-macres__vx7r2cert.adb')

@property
def has_command_line_arguments(self):
return True

@property
def has_single_precision_fpu(self):
return True
Expand Down

0 comments on commit 6d3fccc

Please sign in to comment.