On 30 Jan 2013, at 5:40 PM, D. Jeff Dionne wrote:

> Just for completeness,
> 
> I've done a bisection between SVN r142 and 150:
> r147 builds, and exhibits the same behaviour as 150,
> r142-146 don't build for x86_64 Darwin (various different problems)
> 
> Cheers, and thanks to the group for working on GHDL,
> J.
> 
> On 29 January 2013 22:59, D. Jeff Dionne <djeffdio...@gmail.com> wrote:
>> Hi All,
>> 
>> I've been using the prepackaged mcode r142 version built for Mac OS
>> for a while.  I really will need foreign functions shortly, so I
>> decided to see what the state of the latest code was.

It's my understanding the mcode version can't use foreign functions.  It's 
direct generating.  In other words the mcode version isn't going to do what you 
want in any event.

I haven't look extensively at anything revision 144 to revision 150.  I did 
build revision 150 using a downloaded darwin-9 gnat in my /usr/local/ada-4.3 
directory.  

I don't have the darwin-9 SDK loaded so I can't re gnatlink it for OS X 10.5, 
the product is an i386 binary and it runs cleanly (r150), using my DES chip 
example.

https://mail.gna.org/public/ghdl-discuss/2011-04/msg00009.html
http://www.macada.org
http://www.macada.org/macada/Downloads_files/Gnati386-4.3.dmg  
10.4 darwin8, 2007  Does PPC which isn't of interest here.

http://macada.org/macada/Downloads_files/Gnati386-4.3-xcode3.0.dmg  
10.5 darwin9, 2008  This is the one I have installed, I checked it out.

david_koontz@Macbook: /usr/local/ada-4.3/bin/gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /Volumes/FireLite/Shared/Developer/Compiler/gcc-head/configure 
--disable-checking --enable-static --prefix=/usr/local/ada-4.3 
--with-arch=nocona --with-tune=generic --host=i686-apple-darwin9 
--target=i686-apple-darwin9 --build=i686-apple-darwin9 
--enable-languages=c,ada,c++,objc,obj-c++,fortran
Thread model: posix
gcc version 4.4.0 20080314 (experimental) [trunk revision 133226] (GCC) 

https://mail.gna.org/public/ghdl-discuss/2011-04/msg00009.html
http://www.macada.org/macada/Downloads_files/Gnati386-4.3.dmg

david_koontz@Macbook: ghdl --version
GHDL 0.30dev (20100112) [Sokcho edition]
 Compiled with GNAT Version: 4.4.0 20080314 (experimental)
 mcode code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2010 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

There was one annoying issue with a complaint about line length in 
default_pathes.ads, line 29 (the Post_Processor path), 84 characters where ada 
wants 80.  I simply moved my build tree to /opt, but long term the paths ought 
to be be built from a base by concatenation.

I used target=i386-darwin which satisfies the makefile.  

david_koontz@Macbook: file ghdl_mcode
ghdl_mcode: Mach-O executable i386

Last time I checked with Tristan there weren't valid machine code maps for 
x86_64 for the mcode version.  There are some small number of opcodes used that 
aren't supported in x86-64 and would require remapping (including in the 
runtime).  There's also a different size for the Program Counter (PC).  I'm of 
the impression an x86_64 mcode version would actually be a bit slower.



I get the same error with gcc-4.6.0-x86_64-apple-darwin-10.tar.bz2 which I got 
from sourceforge, and your target.
( http://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/4.6.0/ )


ghdl -e  test_config des_tb

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.30dev (20100112) [Sokcho edition]
Compiled with GNAT Version: 4.6.0
In directory: /Users/david_koontz/Desktop/vhdl_des/
Command line:
ghdl -e test_config des_tb
Exception CONSTRAINT_ERROR raised
Exception information:
Exception name: CONSTRAINT_ERROR
Message: ortho_code-x86-emits.adb:767 range check failed
Call stack traceback locations:
0x10ebc1a31 0x10ebc468a 0x10ebc518b 0x10ebc5b49 0x10eb9cd05 0x10ec94878 
0x10ec9aa7a 0x10ece5948 0x10ece5c24 0x10ecd14e8 0x10ece7673 0x10eceee51 
0x10ecec98e 0x10eb94b30 0x10eb26c83
******************************************************************
make: *** [test_config-des_tb] Error 2

This looks like it won't swallow the opcodes that are produced or something.  
Notice all the addresses are off slightly from your error report.

Looking at the line of source for ortho_code-x86-emits.adb I recall this, it 
has to do with the PC size which should be 64 bit in x86_64 (If I recall 
correctly). I used to have a version of the source partially mapped to x86_64.

These two tests took about 5 minutes apiece.  I had both sets of compilers 
still installed, and I have some aliases for tweaking my search path back and 
forth.

Because you want foreign functions someone needs to make the jump to the object 
code generating version of ghdl on OS X.  I've done so exactly once and don't 
have a current recipe. 


>> 
>> I used gnat-gpl-2012-x86_64-apple-darwin10.8.0-bin.tar.gz from 
>> libre.adacore.com
>> 
>> Building was actually quite simple, and I was able to build from the
>> SVN checkout, using the basic method given by David Koontz, but of
>> course for x86_64:
>> 
>> svn co svn://svn.gna.org/svn/ghdl/trunk ghdl
>> cd ghdl/translate/ghdldrv
>> make target=x86_64-apple-darwin
>> ln -s ghdl_mcode ghdl
>> make target=x86_64-apple-darwin install.mcode
>> 
>> The result is able to analyze, but upon elaboration or run:
>> 
>> ******************** GHDL Bug occured ****************************
>> \


_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to