comp.lang.ada
 help / color / mirror / Atom feed
* Latest GNAT configuration
@ 2002-08-27 16:35 Matt Majka
  2002-08-27 18:16 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Majka @ 2002-08-27 16:35 UTC (permalink / raw)


I am trying to start using GNAT in a RedHat 7.3 environment.
This is my first experience with GNAT since the sources have
been incorporated into the GCC source distribution.  I have
source distributions for binutils-2.13, gcc-3.1.1, and gdb-5.2.1.
I have also downloaded and installed various RPMs from
www.gnuada.org, which I am using to build the Ada compiler from
sources.  My initial question is related to GDB.  I assume
(possibly incorrectly), that support for GNAT is included in
the latest versions of GDB.  However, when I try to debug
a simple test program I get an "internal error - unimplemented
function unk_lang_create_fundamental_type called.", which is
leading me to believe that this may not be the case.  Has anyone
had end-to-end success building GNAT from sources (GCC3) under
Linux and which version of GDB are you using.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latest GNAT configuration
  2002-08-27 16:35 Latest GNAT configuration Matt Majka
@ 2002-08-27 18:16 ` Florian Weimer
  2002-09-03 18:17   ` Matt Majka
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2002-08-27 18:16 UTC (permalink / raw)


matthewmajka@mac.com (Matt Majka) writes:

> I am trying to start using GNAT in a RedHat 7.3 environment.
> This is my first experience with GNAT since the sources have
> been incorporated into the GCC source distribution.  I have
> source distributions for binutils-2.13, gcc-3.1.1, and gdb-5.2.1.
> I have also downloaded and installed various RPMs from
> www.gnuada.org, which I am using to build the Ada compiler from
> sources.

You should get GNAT 3.14p.  The RPMs at gnuada.org are still at 3.13p,
which is not quite enough.

> My initial question is related to GDB.  I assume (possibly
> incorrectly), that support for GNAT is included in the latest
> versions of GDB.

No, it isn't.

> However, when I try to debug a simple test program
> I get an "internal error - unimplemented function
> unk_lang_create_fundamental_type called."

AFAIK, this has been fixed, so you can at least debug the Ada program
as if it were C (sort of).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latest GNAT configuration
  2002-08-27 18:16 ` Florian Weimer
@ 2002-09-03 18:17   ` Matt Majka
  2002-09-03 18:23     ` Samuel Tardieu
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Majka @ 2002-09-03 18:17 UTC (permalink / raw)


Florian Weimer <fw@deneb.enyo.de> wrote in message news:<87lm6sjhga.fsf@deneb.enyo.de>...
> matthewmajka@mac.com (Matt Majka) writes:
> 
> > I am trying to start using GNAT in a RedHat 7.3 environment.
> > This is my first experience with GNAT since the sources have
> > been incorporated into the GCC source distribution.  I have
> > source distributions for binutils-2.13, gcc-3.1.1, and gdb-5.2.1.
> > I have also downloaded and installed various RPMs from
> > www.gnuada.org, which I am using to build the Ada compiler from
> > sources.
> 
> You should get GNAT 3.14p.  The RPMs at gnuada.org are still at 3.13p,
> which is not quite enough.

If I use GNAT 3.14p, which is based on GCC-2.8.1, will there be any
incompatibilities between my Ada object code and C or C++ object code
generated by the GCC-3 compilers?
 
> > However, when I try to debug a simple test program
> > I get an "internal error - unimplemented function
> > unk_lang_create_fundamental_type called."
> 
> AFAIK, this has been fixed, so you can at least debug the Ada program
> as if it were C (sort of).


To be clear, are you saying that there is a fix for GDB that allows it
to debug Ada programs compiled with the GCC-3.1.1 version of the
compiler?  Could you point me to it?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latest GNAT configuration
  2002-09-03 18:17   ` Matt Majka
@ 2002-09-03 18:23     ` Samuel Tardieu
  2002-09-04 22:14       ` Matt Majka
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Tardieu @ 2002-09-03 18:23 UTC (permalink / raw)


>>>>> "Matt" == Matt Majka <matthewmajka@mac.com> writes:

Matt> If I use GNAT 3.14p, which is based on GCC-2.8.1, will there be
Matt> any incompatibilities between my Ada object code and C or C++
Matt> object code generated by the GCC-3 compilers?
 
Which C++ compiler are you talking about? The C++ ABI of GCC 3.1 and
GCC 3.2 are incompatible with each others...

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latest GNAT configuration
  2002-09-03 18:23     ` Samuel Tardieu
@ 2002-09-04 22:14       ` Matt Majka
  2002-09-13 16:24         ` Ludovic Brenta
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Majka @ 2002-09-04 22:14 UTC (permalink / raw)


Samuel Tardieu <sam@rfc1149.net> wrote in message news:<87znuzorto.fsf@inf.enst.fr>...
> >>>>> "Matt" == Matt Majka <matthewmajka@mac.com> writes:
> 
> Matt> If I use GNAT 3.14p, which is based on GCC-2.8.1, will there be
> Matt> any incompatibilities between my Ada object code and C or C++
> Matt> object code generated by the GCC-3 compilers?
>  
> Which C++ compiler are you talking about? The C++ ABI of GCC 3.1 and
> GCC 3.2 are incompatible with each others...
> 
>   Sam

All C and C++ code will be using GCC 3.1.1.  I hope to use the Ada
compiler in GCC 3.1.1 as well, but there appear to be GDB deficiencies
at this time.  I am wondering if there are any known problems with
using GCC 2.8.1 for Ada and GCC 3.1.1 for all other code (C and C++)
in the same binary.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latest GNAT configuration
  2002-09-04 22:14       ` Matt Majka
@ 2002-09-13 16:24         ` Ludovic Brenta
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Brenta @ 2002-09-13 16:24 UTC (permalink / raw)


On 4 Sep 2002 15:14:28 -0700
matthewmajka@mac.com (Matt Majka) wrote:
> All C and C++ code will be using GCC 3.1.1.  I hope to use the Ada
> compiler in GCC 3.1.1 as well, but there appear to be GDB deficiencies
> at this time.  I am wondering if there are any known problems with
> using GCC 2.8.1 for Ada and GCC 3.1.1 for all other code (C and C++)
> in the same binary.

FWIW, I had a toy shared library/DLL written in Ada calling callbacks
from the main program written in C.  On Windows, I used MinGW 2.0.0 gcc
3.2 for the Ada source, and Metrowerks CodeWarrior 7.2 for the C source.
On Linux I used gnat 3.13p (RPM) and gcc 3.0.1 respectively.  I found
the interfaces to work flawlessly (granted, I only did limited testing).

However, as someone else pointed out, the C++ ABI's are different
between versions of GCC.  They may also be different between compilers. 
So, my advice would be to make sure you use C (not C++) interfaces
between your Ada and your non-Ada code.

To achieve this, for Ada code that exports subprograms, use Pragma
Export(C) not C++ and in the C/C++ header files use extern "C" to
import the subprograms.  If you want to call C++ code from Ada, you'd
need to write a C wrapper and import the C wrapper from Ada using Pragma
Import(C).

On Windows, there are additional steps to take if you want to write a
DLL in Ada and call it from non-GCC compilers.  These steps are to
create a library definition file (.def) using gnatlink
-Wl,--output-def,library.def; and then to create an import library from
the def file.  To create the import library, you need Microsoft's
librarian (LIB.EXE) and linker (LINK.EXE) which come with the Windows
SDK.  I've found this to be necessary when compiling the client code
with CodeWarrior.  Perhaps it will also be necessary if mixing versions
of GCC on Windows.

HTH

--
Ludovic Brenta



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-09-13 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 16:35 Latest GNAT configuration Matt Majka
2002-08-27 18:16 ` Florian Weimer
2002-09-03 18:17   ` Matt Majka
2002-09-03 18:23     ` Samuel Tardieu
2002-09-04 22:14       ` Matt Majka
2002-09-13 16:24         ` Ludovic Brenta

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