aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-07-18 21:11:55 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-18 21:11:55 +0200
commit207e6dc071b5f336909072096c3a760e6595e5c7 (patch)
tree6518bf8a84a47fc2b0a978fbfbbdd57f5f1bf445 /src/grt
parentfd1e5d630069ccafa79f39fc1fa389f6e5f1fa50 (diff)
downloadghdl-207e6dc071b5f336909072096c3a760e6595e5c7.tar.gz
ghdl-207e6dc071b5f336909072096c3a760e6595e5c7.tar.bz2
ghdl-207e6dc071b5f336909072096c3a760e6595e5c7.zip
Work-around deprecated use of pragma No_Run_Time in gnat gpl 2016.
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/Makefile.inc6
-rw-r--r--src/grt/grt-c.ads3
-rw-r--r--src/grt/grt.adc14
3 files changed, 18 insertions, 5 deletions
diff --git a/src/grt/Makefile.inc b/src/grt/Makefile.inc
index 4a8af7646..f60a845ae 100644
--- a/src/grt/Makefile.inc
+++ b/src/grt/Makefile.inc
@@ -88,7 +88,8 @@ ifneq ($(LIBBACKTRACE),)
endif
# Configuration pragmas.
-GRT_PRAGMA_FLAG=-gnatec$(GRTSRCDIR)/grt.adc -gnat05
+# -gnatdY is required to force the use of __gnat_last_chance_handler.
+GRT_PRAGMA_FLAG=-gnatec$(GRTSRCDIR)/grt.adc -gnat05 -gnatdY
# Rule to compile an Ada file.
GRT_ADACOMPILE=$(ADAC) -c $(GRT_FLAGS) $(GRT_PRAGMA_FLAG) -o $@ $<
@@ -104,6 +105,9 @@ libgrt.a: $(GRT_ADD_OBJS) run-bind.o main.o grt-files
run-bind.adb: $(GRT_SRC_DEPS) grt-force
gnatmake -c -aI$(GRTSRCDIR) $(GRT_PRAGMA_FLAG) \
ghdl_main $(GRT_ADAFLAGS) -cargs $(GRT_FLAGS)
+# Set No Run-Time flag to suppress references to standard gnat library.
+ sed -e '/^P /s/P /P NR /' < ghdl_main.ali > ghdl_main-tmp.ali
+ mv ghdl_main-tmp.ali ghdl_main.ali
gnatbind -Lgrt_ -o run-bind.adb -n ghdl_main.ali
#system.ads:
diff --git a/src/grt/grt-c.ads b/src/grt/grt-c.ads
index 24003cf4a..7b921938d 100644
--- a/src/grt/grt-c.ads
+++ b/src/grt/grt-c.ads
@@ -33,13 +33,14 @@ package Grt.C is
-- Type void * and char *.
subtype voids is System.Address;
subtype chars is System.Address;
- subtype long is Long_Integer;
-- Type size_t.
type size_t is mod 2 ** Standard'Address_Size;
-- Type int. It is an alias on Integer for simplicity.
subtype int is Integer;
+ subtype long is Long_Integer;
+ type unsigned is mod 2 ** Integer'Size;
-- Low level memory management.
procedure Free (Addr : System.Address);
diff --git a/src/grt/grt.adc b/src/grt/grt.adc
index 71c315b71..12091ce18 100644
--- a/src/grt/grt.adc
+++ b/src/grt/grt.adc
@@ -35,9 +35,8 @@
-- This files is *not* names gnat.adc, in order to ease the possibility of
-- not using it.
pragma Restrictions (No_Exception_Handlers);
---pragma restrictions (No_Exceptions);
+pragma Restrictions (No_Exception_Propagation);
pragma Restrictions (No_Secondary_Stack);
---pragma Restrictions (No_Elaboration_Code);
pragma Restrictions (No_Dispatch);
pragma Restrictions (No_Io);
pragma Restrictions (No_Finalization);
@@ -46,5 +45,14 @@ pragma restrictions (no_dependence => GNAT);
pragma Restrictions (Max_Tasks => 0);
pragma Restrictions (No_Task_Hierarchy);
pragma Restrictions (No_Implicit_Heap_Allocations);
+pragma Restrictions (No_Initialize_Scalars);
pragma Suppress (Overflow_Check);
-pragma No_Run_Time;
+
+-- Too strong:
+-- pragma Restrictions (No_Elaboration_Code);
+
+-- Would be nice, but not allowed.
+-- pragma Restrictions (No_Multiple_Elaboration);
+
+-- Not supported by crippled gnat.
+-- pragma No_Run_Time;