comp.lang.ada
 help / color / mirror / Atom feed
From: Markus E Leypold <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de>
Subject: Re: Trig Function Linking Problems
Date: Tue, 17 Apr 2007 12:55:21 +0200
Date: 2007-04-17T12:55:21+02:00	[thread overview]
Message-ID: <lsirbvp8x2.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: 1176803966.623937.251290@e65g2000hsc.googlegroups.com


AJAskey <AskeyAJ@gmail.com> writes:

> Thanks for the responses.  I really think the pragma "c" call to the
> actual Linux math library is not working.  I've had this same problem
> many times over the years.  In "c", many times I would not get an
> error message at link time if it could not find the correct library
> with the sin(), cos(), etc calls.  The "c" function would "appear" to
> work (step into somewhere in the debugger) but garbage was always
> returned.  This appears to be what is happening.  Ada knows it is a
> valid call and doesn't complain.  But somewhere in the depths of the
> call nothing actually happens.
>
> If I set b=1.0 then make the call b:=sin(a), b is changed to NaN.
> Something is happening but definitely not the sine function.
>
> If I had written the call then I would assume the code was wrong.  But
> I am using code from the GNAT Ada library that works fine on a
> different computer.  I'm pretty sure it has something to do with the
> gnatlink activity.  Either something is defaulting correctly on the
> working system that is not the default on the newer system, or it just
> cannot find the library.  I tested the same simple algorithm in "c"
> and it works fine - which means the library is available on the
> system.
>
> If anyone has any other ideas please let me know as this is a show
> stopper.

There are switches to see how (paths and all) the c compiler is called
behind the scenes. There are switches that can be passed through to
gcc which make gcc show how it calls the linker and various processing
stages. Try them.

Try nm and ldd on finished binaires and intermediate object files to
see linkage, exports and definitions.

If your theory about libm not getting linked right is true, then you
should see something unusual.

BTW: Your new target is a RH 7. I seem to remember that they were
still in the process of switching libc and had an experimental egcs
compiler. So something messed up in linking, calling the right
compiler stages, assembler or dynmic linking is probably a good first
gues.

Regards -- Markus




  reply	other threads:[~2007-04-17 10:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16 20:32 Trig Function Linking Problems AJAskey
2007-04-16 22:46 ` Jeffrey Creem
2007-04-16 23:39   ` Markus E Leypold
2007-04-17  9:59     ` AJAskey
2007-04-17 10:55       ` Markus E Leypold [this message]
2007-04-17 11:48         ` AJAskey
2007-04-17 12:05           ` Markus E Leypold
2007-04-17 12:32       ` Ludovic Brenta
2007-04-17  0:22 ` Jeffrey R. Carter
2007-04-17 16:58 ` Dirk Heinrichs
2007-04-17 18:54   ` AJAskey
2007-04-17 20:50     ` Ludovic Brenta
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox