aboutsummaryrefslogtreecommitdiffstats
path: root/translate/grt
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-12-10 17:10:16 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-12-10 17:10:16 +0000
commitb6411279b6ac6dcde21ed5f0edf28443e1c41fe1 (patch)
tree30a464152dba82412434f65647103cdb58886ce7 /translate/grt
parent0f9939eac0c16b59814e92dd108a555041a49837 (diff)
downloadghdl-b6411279b6ac6dcde21ed5f0edf28443e1c41fe1.tar.gz
ghdl-b6411279b6ac6dcde21ed5f0edf28443e1c41fe1.tar.bz2
ghdl-b6411279b6ac6dcde21ed5f0edf28443e1c41fe1.zip
updated
Diffstat (limited to 'translate/grt')
-rw-r--r--translate/grt/Makefile.inc16
-rw-r--r--translate/grt/grt-cbinding.c6
2 files changed, 15 insertions, 7 deletions
diff --git a/translate/grt/Makefile.inc b/translate/grt/Makefile.inc
index e5643bdfb..4df527501 100644
--- a/translate/grt/Makefile.inc
+++ b/translate/grt/Makefile.inc
@@ -41,26 +41,28 @@ else
osys:=$(word 3,$(targ))
endif
+GRT_ELF_OPTS:=-Wl,--version-script=@/grt.ver -Wl,--export-dynamic
+
# Set target files.
ifeq ($(filter-out i%86 linux,$(arch) $(osys)),)
GRT_TARGET_OBJS=i386.o linux.o times.o
- GRT_EXTRA_LIB=-ldl
+ GRT_EXTRA_LIB=-ldl -lm $(GRT_ELF_OPTS)
endif
ifeq ($(filter-out x86_64 linux,$(arch) $(osys)),)
GRT_TARGET_OBJS=amd64.o linux.o times.o
- GRT_EXTRA_LIB=-ldl
+ GRT_EXTRA_LIB=-ldl -lm $(GRT_ELF_OPTS)
endif
ifeq ($(filter-out sparc solaris%,$(arch) $(osys)),)
GRT_TARGET_OBJS=sparc.o linux.o times.o
- GRT_EXTRA_LIB=-ldl
+ GRT_EXTRA_LIB=-ldl -lm
endif
ifeq ($(filter-out powerpc linux%,$(arch) $(osys)),)
GRT_TARGET_OBJS=ppc.o linux.o times.o
- GRT_EXTRA_LIB=-ldl
+ GRT_EXTRA_LIB=-ldl -lm $(GRT_ELF_OPTS)
endif
ifeq ($(filter-out ia64 linux,$(arch) $(osys)),)
GRT_TARGET_OBJS=ia64.o linux.o times.o
- GRT_EXTRA_LIB=-ldl
+ GRT_EXTRA_LIB=-ldl -lm $(GRT_ELF_OPTS)
endif
ifeq ($(filter-out i%86 mingw32,$(arch) $(osys)),)
GRT_TARGET_OBJS=win32.o clock.o
@@ -71,7 +73,7 @@ endif
# Fall-back: use a generic implementation based on pthreads.
ifndef GRT_TARGET_OBJS
GRT_TARGET_OBJS=pthread.o times.o
- GRT_EXTRA_LIB=-lpthread -ldl
+ GRT_EXTRA_LIB=-lpthread -ldl -lm
endif
# Additionnal object files (C or asm files).
@@ -93,7 +95,7 @@ GRT_ADACOMPILE=$(ADAC) -c $(GRT_FLAGS) $(GRT_PRAGMA_FLAG) -o $@ $<
grt-all: libgrt.a grt.lst
-libgrt.a: grt-arch.ads $(GRT_ADD_OBJS) run-bind.o main.o grt-files
+libgrt.a: $(GRT_ADD_OBJS) run-bind.o main.o grt-files # grt-arch.ads
$(RM) -f $@
$(AR) rcv $@ `sed -e "/^-/d" < grt-files` $(GRT_ADD_OBJS) \
run-bind.o main.o
diff --git a/translate/grt/grt-cbinding.c b/translate/grt/grt-cbinding.c
index bb0bd17be..61e474d28 100644
--- a/translate/grt/grt-cbinding.c
+++ b/translate/grt/grt-cbinding.c
@@ -38,6 +38,12 @@ __ghdl_get_stderr (void)
return stderr;
}
+void
+__ghdl_snprintf_g (char *buf, int len, double val)
+{
+ snprintf (buf, len, "%g", val);
+}
+
static int run_env_en;
static jmp_buf run_env;