![]() |
|
|
|
#1 |
|
User-Agent: OSXnews 2.07
Xref: number1.nntp.dca.giganews.com comp.lang.vhdl:57850 Hi all, I've got a linking problem using the ieee.math_real package with ghdl. I removed nearly all code from my Application (see below) and it compiles as far as I remove the 'use ieee.math_real.all'. Here's what I got from the console (without removing the ieee.math_real.all) So here is what I got from the console: >ghdl -a CompMy.vhdl > ghdl -e CompMy /usr/bin/ld: /Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o has external relocation entries in non-writable section (__TEXT,__text) for symbols:_atanh _acosh _atan2 _acos _asin _log _exp _sqrt collect2: ld returned 1 exit status ghdl: compilation error MyComp.vhdl: library ieee; use ieee.std_logic_1164.all; use ieee.math_real.all; entity compMy is port( clk : in std_logic); end compMy; architecture behaviour of compMy is begin StateMy: process(clk) begin if(clk = '1' and clk'event) then wait 1 ns; end if; end process StateMy; end behaviour; I'm using ghdl 0.20 (20051015) on Mac OSX 10.4.3 with Xcode 2.0 Looking at google had no success and the ghdl doc's aren't very detailed, so anybody got a hint for me? Thanks says Andreas Andreas |
|
|
|
|
#2 |
|
Posts: n/a
|
Andreas wrote:
> entity compMy is > port( clk : in std_logic); > end compMy; > > architecture behaviour of compMy is > begin > StateMy: process(clk) > begin > if(clk = '1' and clk'event) then > wait 1 ns; > Looking at google had no success and the ghdl doc's aren't very > detailed, so anybody got a hint for me? get rid of the wait or the process list. It's either one or the other. -- Mike Treseler Mike Treseler |
|
|
|
#3 |
|
Posts: n/a
|
Andreas a écrit : > User-Agent: OSXnews 2.07 > Xref: g2news1.google.com comp.lang.vhdl:1636 > > > > Hi all, > > I've got a linking problem using the ieee.math_real package with ghdl. I > removed nearly all code from my Application (see below) and it compiles > as far as I remove the 'use ieee.math_real.all'. Here's what I got > from the console (without removing the ieee.math_real.all) > So here is what I got from the console: > >ghdl -a CompMy.vhdl > > ghdl -e CompMy > /usr/bin/ld: > /Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o has external relocation > entries in non-writable section (__TEXT,__text) for symbols:_atanh > _acosh > _atan2 > _acos > _asin > _log > _exp > _sqrt > collect2: ld returned 1 exit status > ghdl: compilation error > I'm using ghdl 0.20 (20051015) on Mac OSX 10.4.3 with Xcode 2.0 > > Looking at google had no success and the ghdl doc's aren't very > detailed, so anybody got a hint for me? Hi, >From ghdl mailing list, you should add -Wl,-lm during elaboration. JD. john Doef |
|
|
|
#4 |
|
Posts: n/a
|
User-Agent: OSXnews 2.07
Xref: number1.nntp.dca.giganews.com comp.lang.vhdl:57861 >Mike Treseler <> wrote: > >get rid of the wait or the process list. >It's either one or the other. Hi Mike, thanks for the hint, but I don't think it's the wait statement or the process list, since the file compiles without the 'use ieee.math_real.all; ' line and works as expected.So this produces no errors: library ieee; use ieee.std_logic_1164.all; entity compMy is port( clk : in std_logic); end compMy; ... and this does produce the errors mentioned in my original posting: library ieee; use ieee.std_logic_1164.all; use ieee.math_real.all; entity compMy is port( clk : in std_logic); end compMy; ... So if there's a problem with wait or the process it should arise in both cases,isn't it? Andreas Andreas |
|
|
|
#5 |
|
Posts: n/a
|
> ghdl -e CompMy
> > /usr/bin/ld: > /Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o has external relocation > entries in non-writable section (__TEXT,__text) for symbols:_atanh > _acosh > _atan2 > _acos > _asin > _log > _exp > _sqrt > collect2: ld returned 1 exit status > ghdl: compilation error The linker tells you that the object code of your compiled design references math functions that can't be resolved. You want to pass the approriate option to the linker so that libm is considered during linking: $ ghdl -e -Wl,-lm CompMy Best regards Arnim Arnim Laeuger |
|
|
|
#6 |
|
Posts: n/a
|
User-Agent: OSXnews 2.07
Xref: number1.nntp.dca.giganews.com comp.lang.vhdl:57863 Arnim Laeuger <> wrote: >The linker tells you that the object code of your compiled design >references math functions that can't be resolved. >You want to pass the approriate option to the linker so that libm is >considered during linking: > >$ ghdl -e -Wl,-lm CompMy Hi Arnim, that's more the direction my thought go to. But it seems that libm isn't the right library, since I got the same error again. Maybe I have to pass the math_real library to the compiler, but I couldn't find the library files, just the object files (the ones that the linker mentioned) Best regards Andreas Andreas |
|
|
|
#7 |
|
Posts: n/a
|
Hi!
>>You want to pass the approriate option to the linker so that libm is >>considered during linking: >> >>$ ghdl -e -Wl,-lm CompMy > > that's more the direction my thought go to. But it seems that libm isn't > the right library, since I got the same error again. Maybe I have to > pass the math_real library to the compiler, but I couldn't find the > library files, just the object files (the ones that the linker mentioned) Strange, elaboration works here with the mentioned option while it fails without. Is the gcc tool-chain set-up properly on your machine? Can you compile the following C-code: #include <stdio.h> #include <math.h> int main (int argc, char *argv[]) { printf("sin(0): %f\n", sin(0)); return(0); } $ gcc -o tm -lm tm.c Besides that, googling for the error message reveals a lot of reports describing this problem on powerpc-apple-* systems. One common solution is to pass option -lcc_dynamic to the linker: http://sourceforge.net/mailarchive/f...m onth=200307 http://null.perl-hackers.net/archives/programming/ No idea what it is required for. This translates to the following elaboration command: $ ghdl -e -Wl,-lm -Wl,-lcc_dynamic CompMy Sorry, here you're on your own as I have no possibility to test such things myself. Cheers Arnim Arnim Laeuger |
|
|
|
#8 |
|
Posts: n/a
|
In article <dplteo$5o1$01$>,
Andreas <> wrote: > >Arnim Laeuger <> wrote: >>The linker tells you that the object code of your compiled design >>references math functions that can't be resolved. >>You want to pass the approriate option to the linker so that libm is >>considered during linking: >> >>$ ghdl -e -Wl,-lm CompMy That recommendation would be for the case where you were trying to write some foreign models in C and were trying to call functions in C's libm. Not the case here. He's trying to call some functions from math_real. > >Hi Arnim, >that's more the direction my thought go to. But it seems that libm isn't >the right library, since I got the same error again. Maybe I have to >pass the math_real library to the compiler, but I couldn't find the >library files, just the object files (the ones that the linker mentioned) Yes, I think you need to recompile math_real. Did you recently upgrade to a newer GHDL version? I would look for math_real.vhd somewhere on the web and try putting it in your directory and then math_real.vhd before you do the linking step. Phil Phil Tomson |
|
|
|
#9 |
|
Posts: n/a
|
In article <dpkdme$b79$02$>,
Andreas <> wrote: > > >Hi all, > >I've got a linking problem using the ieee.math_real package with ghdl. I >removed nearly all code from my Application (see below) and it compiles >as far as I remove the 'use ieee.math_real.all'. Here's what I got >from the console (without removing the ieee.math_real.all) >So here is what I got from the console: > >ghdl -a CompMy.vhdl >> ghdl -e CompMy >/usr/bin/ld: >/Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o has external relocation >entries in non-writable section (__TEXT,__text) for symbols:_atanh >_acosh >_atan2 >_acos >_asin >_log >_exp >_sqrt >collect2: ld returned 1 exit status >ghdl: compilation error > > >MyComp.vhdl: > >library ieee; >use ieee.std_logic_1164.all; >use ieee.math_real.all; > >entity compMy is > port( clk : in std_logic); >end compMy; > >architecture behaviour of compMy is >begin > StateMy: process(clk) > begin > if(clk = '1' and clk'event) then > wait 1 ns; > end if; > end process StateMy; >end behaviour; > >I'm using ghdl 0.20 (20051015) on Mac OSX 10.4.3 with Xcode 2.0 > >Looking at google had no success and the ghdl doc's aren't very >detailed, so anybody got a hint for me? >Thanks says >Andreas > here's my guess: Did you build ghdl on OSX, or did you get a ready-made executable? First off, try this: > gcc_select If it returns a message that says something about the current default gcc is 4.0.x, then try the following: > sudo gcc_select 3.3 (that will change the gcc version used from then on to 3.3 instead of Tiger's default 4.x) From the error listing above, it looks like you're using 4.0.2: >/Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2 Then run your ghdl -a, ghdl -e commands over again. My guess is that maybe the ghdl executable and libraries you downloaded were built with gcc 3.3 and thus will not work if you're using gcc 4.0.x. Or possibly, it's the other way around, maybe the ghdl package you downloaded was compiled with gcc 4.0.x and you've done a gcc_select 3.3 somewhere along the line? If gcc_select told you that the default gcc is 3.3, then try setting the default back to 4.0: > sudo gcc_select 4.0 ....and then run the analysis and elaboration again... (I still have ghdl 0.17 installed on my OSX machine, so I can't quite reproduce what you're seeing because 0.17 didn't seem to come with a math_real library at all.) Phil Phil Tomson |
|
|
|
#10 |
|
Posts: n/a
|
In article <>,
Phil Tomson <> wrote: >In article <dpkdme$b79$02$>, >Andreas <> wrote: >> >> >>Hi all, >> >>I've got a linking problem using the ieee.math_real package with ghdl. I >>removed nearly all code from my Application (see below) and it compiles >>as far as I remove the 'use ieee.math_real.all'. Here's what I got >>from the console (without removing the ieee.math_real.all) >>So here is what I got from the console: >> >ghdl -a CompMy.vhdl >>> ghdl -e CompMy >>/usr/bin/ld: >>/Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o has external relocation >>entries in non-writable section (__TEXT,__text) for symbols:_atanh >>_acosh >>_atan2 >>_acos >>_asin >>_log >>_exp >>_sqrt >>collect2: ld returned 1 exit status >>ghdl: compilation error >> >> >>MyComp.vhdl: >> >>library ieee; >>use ieee.std_logic_1164.all; >>use ieee.math_real.all; >> >>entity compMy is >> port( clk : in std_logic); >>end compMy; >> >>architecture behaviour of compMy is >>begin >> StateMy: process(clk) >> begin >> if(clk = '1' and clk'event) then >> wait 1 ns; >> end if; >> end process StateMy; >>end behaviour; >> >>I'm using ghdl 0.20 (20051015) on Mac OSX 10.4.3 with Xcode 2.0 >> >>Looking at google had no success and the ghdl doc's aren't very >>detailed, so anybody got a hint for me? >>Thanks says >>Andreas >> > >here's my guess: > > Did you build ghdl on OSX, or did you get a ready-made executable? > >First off, try this: >> gcc_select > >If it returns a message that says something about the current default gcc is >4.0.x, then try the following: > >> sudo gcc_select 3.3 > >(that will change the gcc version used from then on to 3.3 instead of >Tiger's default 4.x) From the error listing above, it looks like you're using >4.0.2: >>/Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2 > >Then run your ghdl -a, ghdl -e commands over again. > >My guess is that maybe the ghdl executable and libraries you downloaded were >built with gcc 3.3 and thus will not work if you're using gcc 4.0.x. > >Or possibly, it's the other way around, maybe the ghdl package you downloaded >was compiled with gcc 4.0.x and you've done a gcc_select 3.3 somewhere along >the line? If gcc_select told you that the default gcc is 3.3, then try >setting the default back to 4.0: > >> sudo gcc_select 4.0 > >...and then run the analysis and elaboration again... > >(I still have ghdl 0.17 installed on my OSX machine, so I can't quite >reproduce what you're seeing because 0.17 didn't seem to come with a >math_real library at all.) > Sorry to answer my own post, but here's another datapoint: I installed 0.20 and set gcc_select to 3.3 and I get the following: l% sudo gcc_select 3.3 Default compiler has been set to: gcc version 3.3 20030304 (Apple Computer, Inc. build 1809) % ghdl -a CompMy.vhd % ghdl -e compMy ld: warning prebinding disabled because of undefined symbols ld: Undefined symbols: _fprintf$LDBLStub _vprintf$LDBLStub ghdl: compilation error (BTW: you need to get rid of the wait statement in your VHDL file) Then I switched to 4.0 and tried it: % sudo gcc_select 4.0 Default compiler has been set to: gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061) % ghdl -a CompMy.vhd % ghdl -e compMy /usr/bin/ld: /Developer/Simulator/GHDL/lib/gcc/powerpc-apple-darwin8.2.1/4.0.2/vhdl/lib/v93/ieee/math_real-body.o relocation overflow for relocation entry 294 in section (__TEXT,__text) (displacement too large) (commenting out the line: use ieee.math_real.all; leads to success, so the problem is with that library) I would send an email to Felix Bertram: He's the maintainer of the ghdl OSX package. Phil Phil Tomson |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newbie; what is the best software to convert DVD (Vob) file to avi - divx ? | Laura25 | DVD Video | 4 | 07-12-2006 03:03 PM |
| NEWBIE - DVD burn problem - need help | Vic Baron | DVD Video | 6 | 09-29-2005 10:56 PM |
| newbie | Chris | A+ Certification | 1 | 08-16-2005 12:53 AM |
| Another newbie question | Jerold Pearson | DVD Video | 1 | 12-11-2004 02:25 AM |
| Newbie to Linux Mandrake | Volund | A+ Certification | 5 | 10-01-2004 03:12 PM |