public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Ada and x86_64
@ 2002-08-26 13:58 Richard Kenner
  2002-08-27  1:17 ` Andreas Jaeger
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Kenner @ 2002-08-26 13:58 UTC (permalink / raw)
  To: jh; +Cc: gcc

    I guess ada has no preprocessor, but perhaps there is a way.  Ada
    experts, please?  Also what else needs to be changed?

It's a 64-bit machine, so the library files need to be a mix of those for
64-bit machines (such as Alpha) and those for the x86 architecture.

It's definitely a new port and you need to add new library files for it.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-29  3:13 Robert Dewar
  0 siblings, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-29  3:13 UTC (permalink / raw)
  To: dewar, jh, kenner; +Cc: gcc

>>I believe that Sam Tardieu did this port, or at least knows of it.

Sorry, I forgot to supply context

this port = port for Linux Alpha 64 bit

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-29  3:03 Robert Dewar
  0 siblings, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-29  3:03 UTC (permalink / raw)
  To: jh, kenner; +Cc: gcc

I believe that Sam Tardieu did this port, or at least knows of it.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-28 16:07 Richard Kenner
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Kenner @ 2002-08-28 16:07 UTC (permalink / raw)
  To: jh; +Cc: gcc

    > We have not ported GNAT to 64bit Alpha Linux, though I believe someone
    > else has done this port.

    Would be possible to see the code

The first step is to locate whoever did that port ...

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-28  4:49 Robert Dewar
  2002-08-28  4:50 ` Andreas Jaeger
  0 siblings, 1 reply; 37+ messages in thread
From: Robert Dewar @ 2002-08-28  4:49 UTC (permalink / raw)
  To: aj, dje; +Cc: dewar, gcc, jh

> > David Edelsohn <dje@watson.ibm.com> writes:
> >
> >> While knowing nothing about Ada,
> >>
> >>      private
> >>         type sigset_t is array (0 .. 31) of unsigned_long;
> >>         pragma Convention (C, sigset_t);
> >>         for sigset_t'Size use 1024;
> >
> > unsigned_long is is 64 bit on x86-64, I think , so the minimum size
> > for the array is indeed 2048 bits.  You could change unsigned_long to
> > unsigned_int; this should in 1024 bits on x86-64, too.  However, I'm
> > not sure if sigset_t really has this size on x86-64.
> 
> The solution we come up with is to use array (0..15) to get 1024
> bytes,


This is only the correct solution if that matches the definition of sigset_t
in C. There is nothing sacred out the size in the size clause. it must be
modified to meet the requirement of matching the C definition.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-28  4:47 Robert Dewar
  0 siblings, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-28  4:47 UTC (permalink / raw)
  To: dje, fw; +Cc: aj, dewar, gcc, jh

> > While knowing nothing about Ada,
> >
> >       private
> >          type sigset_t is array (0 .. 31) of unsigned_long;
> >          pragma Convention (C, sigset_t);
> >          for sigset_t'Size use 1024;
> 
> unsigned_long is is 64 bit on x86-64, I think , so the minimum size
> for the array is indeed 2048 bits.  You could change unsigned_long to
> unsigned_int; this should in 1024 bits on x86-64, too.  However, I'm
> not sure if sigset_t really has this size on x86-64.


The whole point of these declarations is to match the C definition for 
sigset_t, and these declarations must be tailored to meet this requirement.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27 14:19 Robert Dewar
  0 siblings, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-27 14:19 UTC (permalink / raw)
  To: aj, dewar; +Cc: gcc, jh, kenner

> Just saying: Look at all files is not documentation.  Please make at
> least some pointer to which files should be looked at and what caveats
> are there.

No one is saying look at all the files, you just need to look at the system
dependent files. The makefile makes it clear what set of files are involved.
Yes, more external documentation on porting would certainly be useful.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27 14:18 Robert Dewar
  0 siblings, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-27 14:18 UTC (permalink / raw)
  To: jh, kenner; +Cc: gcc

> Yes, that brings other question,
> is there way to check basic gnatlib functionality easilly?

The ACVC tests would be just fine for this purpose. Hopefully Laurent wlil be
able to complete the integration of these tests into the FSF environment soon.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27 14:17 Robert Dewar
  2002-08-28  9:45 ` Jan Hubicka
  0 siblings, 1 reply; 37+ messages in thread
From: Robert Dewar @ 2002-08-27 14:17 UTC (permalink / raw)
  To: dewar, jh; +Cc: aj, gcc, kenner

We have not ported GNAT to 64bit Alpha Linux, though I believe someone else
has done this port.

Honza said:

> Is that dificult even in the case that Linux port exists?  I would expect there
> to already be working 64bit Alpha Linux vesion (or not?) so the stuff can just
> be merged together, I hope.

That would certainly be a reasonable first step, and the machines are both
little endian, which helps.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27  5:57 Richard Kenner
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Kenner @ 2002-08-27  5:57 UTC (permalink / raw)
  To: aj; +Cc: gcc

    Just saying: Look at all files is not documentation.  Please make at
    least some pointer to which files should be looked at and what caveats
    are there.

I listed the files.  As Robert said, those specs contain the specification
for that those subprograms need to do, so you need to implement them.  
Obviously, you'll want to use similar versions of these files as guides.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27  5:49 Richard Kenner
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Kenner @ 2002-08-27  5:49 UTC (permalink / raw)
  To: jh; +Cc: gcc

    Is that dificult even in the case that Linux port exists?  I would
    expect there to already be working 64bit Alpha Linux vesion (or not?)
    so the stuff can just be merged together, I hope.

As I said, you can do this and will probably get it to compile.  It might
or might not work exactly correctly since things usually don't go *quite*
that smoothly.  But it's certainly a good "first cut".

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27  4:58 Robert Dewar
  2002-08-27  5:42 ` Jan Hubicka
  2002-08-27  5:55 ` Andreas Jaeger
  0 siblings, 2 replies; 37+ messages in thread
From: Robert Dewar @ 2002-08-27  4:58 UTC (permalink / raw)
  To: jh, kenner; +Cc: aj, gcc

The documentation you need for porting the system dependent files is found
in the specs of the files involved, but it is important to be aware that
creating a new runtime for a new port is a non-trivial task that certainly
requires a good knowledge of Ada and a good familiarity with the structure
of the GNAT runtime (it's all documented, but there is a lot of it). There
is no quick "port GNAT in half an hour" procedure, it just does not exist.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27  4:24 Richard Kenner
  2002-08-27  5:43 ` Jan Hubicka
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Kenner @ 2002-08-27  4:24 UTC (permalink / raw)
  To: jh; +Cc: gcc

    OK, there is quite number of them and I am not really familiar with Ada.
    Is there, by any chance, GNAT porting documenation?
    (or some nice nice document to learn Ada in one hour?)

The issue isn't "learning Ada" as much as it is knowing what parameters need
to be changed for the run-time.  I can't help you much there, since I don't
know it either.

What I'd suggest is looking at the files for Alpha and those for x86 and seeing
if you can tell which are OS-dependent and which are wordsize-dependent and
patch something together that's a mixture of both.  It shouldn't be hard to
get something that will *compile*, but getting something that will actually
properly supporting tasking might indeed be harder.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-27  4:08 Richard Kenner
  2002-08-27  4:13 ` Jan Hubicka
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Kenner @ 2002-08-27  4:08 UTC (permalink / raw)
  To: aj; +Cc: gcc

    Which files exactly need to be added or checked?

All the system-dependent files.  Take a look at the Makefile to see which
are replaced by different files on different targets.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-26 20:50 Robert Dewar
  2002-08-27  2:46 ` Jan Hubicka
  0 siblings, 1 reply; 37+ messages in thread
From: Robert Dewar @ 2002-08-26 20:50 UTC (permalink / raw)
  To: dje, jh; +Cc: aj, dewar, gcc

The file ??osinte.ads must generally be tailored for each architecture, so you
need to write a version of this suitable for the x86_64.

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: Ada and x86_64
@ 2002-08-26 13:49 Richard Kenner
  2002-08-27  3:09 ` Jan Hubicka
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Kenner @ 2002-08-26 13:49 UTC (permalink / raw)
  To: jh; +Cc: gcc

    Does this mean that Ada is basically broken on any 64bit architecture
    not having TImode arithmetics?

It means TImode arithmetic is required.  But why isn't it present on such
archictures?

^ permalink raw reply	[flat|nested] 37+ messages in thread
* Ada and x86_64
@ 2002-08-26 10:14 Jan Hubicka
  2002-08-26 10:20 ` David Edelsohn
  0 siblings, 1 reply; 37+ messages in thread
From: Jan Hubicka @ 2002-08-26 10:14 UTC (permalink / raw)
  To: aj, dewar, gcc

Hi,
I am trying to get Ada working on x86_64 architecture and I am running into
interesting problems.

First problem is use mov TImode divide that is not supported so results in
libcall that is unresolved during building gnatchop.  I've tracked this down
into bitsizetype being TImode and using TImode arithmetic to compute size of
the type.  I can get around by using:
*** stor-layout.c.old   Mon Aug 26 19:03:46 2002
--- stor-layout.c       Mon Aug 26 18:58:19 2002
*************** set_sizetype (type)
*** 1798,1804 ****
       cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit
       precision.  */
    int precision = MIN (oprecision + BITS_PER_UNIT_LOG + 1,
!                      2 * HOST_BITS_PER_WIDE_INT);
    unsigned int i;
    tree t;

--- 1798,1804 ----
       cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit
       precision.  */
    int precision = MIN (oprecision + BITS_PER_UNIT_LOG + 1,
!                      /*2 * HOST_BITS_PER_WIDE_INT*/64);
    unsigned int i;
    tree t;

But is there any idea for proper fix?  Additionally I've modified Makefiles to
thread x86_64 like x86.  That allows me to compile more of the library and tools,
however library build dies at:
../../xgcc -B../../ -c -g -O2 -g -O2   -W -Wall -gnatpg -I. -I/abuild/jh/gcc2/gcc-3.2/gcc/ada s-inmaop.adb
s-osinte.ads:450:26: size for "sigset_t" too small, minimum allowed is 2048

and tools build at:

../xgcc -B../ -c -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long    -W -Wall -gnatpg -gnata -I- -I. -I../../../gcc/ada ../../../gcc/ada/xr_tabls.adb
+===========================GNAT BUG DETECTED==============================+
| 3.2 20020814 (release) (x86_64-unknown-linux-gnu) GCC error:             |
| Internal compiler error in size_binop, at fold-const.c:2014              |
| Error detected at ../../../gcc/ada/xr_tabls.ads:285:41                   |
| Please submit a bug report, see http://gcc.gnu.org/bugs.html .            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

It is again related to sizetype...

Honza

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

end of thread, other threads:[~2002-08-29  3:13 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-26 13:58 Ada and x86_64 Richard Kenner
2002-08-27  1:17 ` Andreas Jaeger
2002-08-27  5:12   ` Joseph S. Myers
  -- strict thread matches above, loose matches on Subject: below --
2002-08-29  3:13 Robert Dewar
2002-08-29  3:03 Robert Dewar
2002-08-28 16:07 Richard Kenner
2002-08-28  4:49 Robert Dewar
2002-08-28  4:50 ` Andreas Jaeger
2002-08-28  4:47 Robert Dewar
2002-08-27 14:19 Robert Dewar
2002-08-27 14:18 Robert Dewar
2002-08-27 14:17 Robert Dewar
2002-08-28  9:45 ` Jan Hubicka
2002-08-27  5:57 Richard Kenner
2002-08-27  5:49 Richard Kenner
2002-08-27  4:58 Robert Dewar
2002-08-27  5:42 ` Jan Hubicka
2002-08-27  5:55 ` Andreas Jaeger
2002-08-27  4:24 Richard Kenner
2002-08-27  5:43 ` Jan Hubicka
2002-08-27  4:08 Richard Kenner
2002-08-27  4:13 ` Jan Hubicka
2002-08-26 20:50 Robert Dewar
2002-08-27  2:46 ` Jan Hubicka
2002-08-26 13:49 Richard Kenner
2002-08-27  3:09 ` Jan Hubicka
2002-08-26 10:14 Jan Hubicka
2002-08-26 10:20 ` David Edelsohn
2002-08-26 10:23   ` Jan Hubicka
2002-08-26 10:53     ` Jan Hubicka
2002-08-26 11:56       ` Jan Hubicka
2002-08-26 12:18         ` David Edelsohn
2002-08-26 12:20           ` Jan Hubicka
2002-08-26 17:35           ` David Brown
2002-08-28  0:57             ` Florian Weimer
2002-08-28  0:52           ` Florian Weimer
2002-08-28  0:56             ` Andreas Jaeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).