comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Multi-arch
Date: Sun, 21 May 2006 13:05:25 GMT
Date: 2006-05-21T13:05:25+00:00	[thread overview]
Message-ID: <pan.2006.05.21.13.08.55.479289@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: 1147857777.703653.268610@j33g2000cwa.googlegroups.com

On Wed, 17 May 2006 02:22:57 -0700, Ludovic Brenta wrote:

> I am following up on the questions raised here about running both
> 32-bit and 64-bit binary code on the same machine. This is called
> biarch.

...
> Thoughts?

Since I have been raising this as an issue in the past few months,
I thought I'd give an update on my progress.

I am now running a prototype stock trading system on an amd64
system running Fedora Core 5 (x86_64).

The problem I had been trying to solve was accessing very large
memory-mapped market data arrays (several GB).  I had run out
of addressing range on ia32 systems.

Moving to amd64, however, I found I couldn't link in commercial 32-bit
library code, available in binary form only.

The system is based around Annex E distributed computing, with
client partitions accessing server code using the 32-bit library
via a Remote_Call_Interface partition.

I now build the system using amd64 architecture for all the
partitions except this Remote_Call_Interface partition, which
is built for i386.  There is no problem mixing architectures
in a program as long as each partition only links in code from
a permitted architecture. (note that it will build invalid
binaries with mixed architecture!)

The build process relies on a full i386 install of FC5 in a
separate set of partitions from the x86_64.  I installed a
complete suite of i386 GNAT tools while running in 32-bit mode.
The machine is dual-bootable, for convenience, but the build
scripts use linux32 and chroot to compile 32-bit when booted
as x86_64.

I have the same source code checked out from cvs in two
separate directories.  The build script checks the architecture,
and if it is x86_64, it builds all the partitions except those
which need the 32-bit library.  Otherwise, it builds all the
partitions.

I build one source tree in a 64 bit environment, the other
in a 32-bit chrooted environment.  I copy the 32-bit-only
partition once built into the 64-bit build directory.
This way, I get two complete working builds.

The GtkAda component 'gate' does not seem to work on x86_64.
This is invoked by the build script in a 32-bit chroot.

I had experimented with -m32 in GNAT, and this produced
working 32-bit .o files, but needed messing with at the linking
stage, since it seemed to be looking in the wrong directories
for the libraries.  This might be made to work fairly easily, but
I cannot get the -m32 switch passed from gnatdist as a compiler
argument.  This seems to be a simple bug(?).

I think having two separate build directories is necessary for
building a mixture of architectures, even if each partition is
needed once, since some .o files are needed in both architectures
(for pure partitions, for example).  I haven't yet arranged it
to build the binaries in side directories from the same source
files.  This would help ensure a consistent code base.

I would like to thank Ludovic Brenta and Martin Krischik (and
others) for working on these issues, providing helpful posts
here at c.l.a, and for providing the necessary packages for
running GNAT on these systems.

The 64-bit system is still at a development stage on a test
machine.  I may try Debian for the production system, but I think
the same build process will be needed until the issues mention
above are fixed.
--
Adrian




  parent reply	other threads:[~2006-05-21 13:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17  9:22 Multi-arch Ludovic Brenta
2006-05-17  9:45 ` Multi-arch Georg Bauhaus
2006-05-17 20:31 ` Multi-arch gshapovalov
2006-05-18 11:39   ` Multi-arch Ludovic Brenta
2006-05-18 16:34     ` Multi-arch gshapovalov
2006-05-18 21:24 ` Multi-arch Björn Persson
2006-05-19  7:23   ` Multi-arch Ludovic Brenta
2006-05-19 21:16     ` Multi-arch Björn Persson
2006-05-20 11:18       ` Multi-arch Ludovic Brenta
2006-05-20 17:51         ` Multi-arch Björn Persson
2006-05-21 16:03   ` Multi-arch Dr. Adrian Wrigley
2006-05-21 13:05 ` Dr. Adrian Wrigley [this message]
2006-05-21 13:41   ` Multi-arch Ludovic Brenta
2006-05-21 16:07     ` Multi-arch Dr. Adrian Wrigley
replies disabled

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