summaryrefslogtreecommitdiff
path: root/translate
diff options
context:
space:
mode:
Diffstat (limited to 'translate')
-rw-r--r--translate/ghdldrv/Makefile16
-rw-r--r--translate/grt/config/linux.c4
-rw-r--r--translate/grt/grt-processes.adb3
-rw-r--r--translate/translation.adb4
4 files changed, 26 insertions, 1 deletions
diff --git a/translate/ghdldrv/Makefile b/translate/ghdldrv/Makefile
index 3838f5c..9e9e1e0 100644
--- a/translate/ghdldrv/Makefile
+++ b/translate/ghdldrv/Makefile
@@ -36,8 +36,22 @@ target=i686-pc-linux-gnu
GRTSRCDIR=../grt
include $(GRTSRCDIR)/Makefile.inc
+ifeq ($(filter-out i%86 linux,$(arch) $(osys)),)
+ ORTHO_X86_FLAGS=Flags_Linux
+endif
+ifeq ($(filter-out i%86 darwin%,$(arch) $(osys)),)
+ ORTHO_X86_FLAGS=Flags_Macosx
+endif
+ifdef ORTHO_X86_FLAGS
+ ORTHO_DEPS=ortho_code-x86-flags.ads
+endif
+
+ortho_code-x86-flags.ads:
+ echo "with Ortho_Code.X86.$(ORTHO_X86_FLAGS);" > $@
+ echo "package Ortho_Code.X86.Flags renames Ortho_Code.X86.$(ORTHO_X86_FLAGS);" >> $@
+
ghdl_mcode: GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
-ghdl_mcode: default_pathes.ads $(GRT_ADD_OBJS) memsegs_c.o chkstk.o force
+ghdl_mcode: default_pathes.ads $(GRT_ADD_OBJS) $(ORTHO_DEPS) memsegs_c.o chkstk.o force
gnatmake -aI../../ortho/mcode $(GNATFLAGS) ghdl_mcode $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB))
memsegs_c.o: ../../ortho/mcode/memsegs_c.c
diff --git a/translate/grt/config/linux.c b/translate/grt/config/linux.c
index 6b73cb4..82df5b9 100644
--- a/translate/grt/config/linux.c
+++ b/translate/grt/config/linux.c
@@ -25,6 +25,10 @@
#include <stdlib.h>
//#include <stdint.h>
+#ifdef __APPLE__
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
/* On x86, the stack growns downward. */
#define STACK_GROWNS_DOWNWARD 1
diff --git a/translate/grt/grt-processes.adb b/translate/grt/grt-processes.adb
index d8d8a61..de76174 100644
--- a/translate/grt/grt-processes.adb
+++ b/translate/grt/grt-processes.adb
@@ -111,6 +111,9 @@ package body Grt.Processes is
begin
if State /= State_Sensitized then
Stack := Stack_Create (Proc, This);
+ if Stack = Null_Stack then
+ Internal_Error ("cannot allocate stack: memory exhausted");
+ end if;
else
Stack := Null_Stack;
end if;
diff --git a/translate/translation.adb b/translate/translation.adb
index 8ce7e0f..4a6d39a 100644
--- a/translate/translation.adb
+++ b/translate/translation.adb
@@ -11047,6 +11047,10 @@ package body Translation is
Push_Identifier_Prefix
(Mark3, Get_Identifier (Get_Base_Name (Formal)));
+ if Is_Anonymous_Type_Definition (In_Type) then
+ In_Type := Get_Base_Type (In_Type);
+ end if;
+
Out_Info := Get_Info (Out_Type);
In_Info := Get_Info (In_Type);