summaryrefslogtreecommitdiff
path: root/translate
diff options
context:
space:
mode:
authorgingold2008-04-09 04:01:16 +0000
committergingold2008-04-09 04:01:16 +0000
commitf63038518ec0b89eb6170e372a2ad5d0a24d30d3 (patch)
treec2155355116acf3f90a2ff0079423cba36b6050d /translate
parenteb4d862a6b8ac3991dac9a8bc2fb0b9d9830e951 (diff)
downloadghdl-f63038518ec0b89eb6170e372a2ad5d0a24d30d3.tar.gz
ghdl-f63038518ec0b89eb6170e372a2ad5d0a24d30d3.tar.bz2
ghdl-f63038518ec0b89eb6170e372a2ad5d0a24d30d3.zip
Improve macosX support.
Fix crashes in error handling.
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);