On Tue, 24 Mar 2015 18:56:49 +0100
Tristan Gingold <[email protected]> wrote:

> So you need to adjust these lines in src/grt/Makefile.inc:

Groovy. With this patch:

--- Makefile.inc.orig   2015-03-24 18:03:24.000000000 -0400
+++ Makefile.inc        2015-03-24 17:58:50.000000000 -0400
@@ -63,7 +63,7 @@
 endif
 ifeq ($(filter-out i%86 freebsd%,$(arch) $(osys)),)
   GRT_TARGET_OBJS=i386.o linux.o times.o
-  GRT_EXTRA_LIB=-lm $(GRT_ELF_OPTS)
+  GRT_EXTRA_LIB=-lm 
   ADAC=ada
 endif
 ifeq ($(filter-out x86_64 freebsd%,$(arch) $(osys)),)


The vests tests pass:

./testsuite.sh: Success (ghdl)
GHDL 0.33dev (20141104) [Dunoon edition]
 Compiled with GNAT Version: 4.9.2 20141030 (release)
 GCC back-end code generator

And a little foreign function (in C) test works. Thanks for the awesome 
response!

Ref:
% gcc -c inc_int.c 
% ghdl -a hello.vhdl && ghdl -e -Wl,inc_int.o hello && ghdl -r hello
Hello world!
4

% cat inc_int.c 

int inc_int(int num) {
        num++;
        return num;
}

% cat hello.vhdl 

use std.textio.all;

entity hello is
end hello;
     
architecture behaviour of hello is
begin
        process
                variable l : line;
                variable data : integer;
                function inc_int (v : integer) return integer is
                begin
                        assert false severity failure;
                end inc_int;
                attribute foreign of inc_int : function is "VHPIDIRECT inc_int";
        begin
                write (l, String'("Hello world!"));
                writeline (output, l);
                data := inc_int(3);
                write (l, data);
                writeline (output, l);
                wait;
        end process;
end behaviour;

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to