From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eeee56c19a542f8d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!newspeer1-win.ntli.net!newsfe2-gui.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: Multi-arch User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: <1147857777.703653.268610@j33g2000cwa.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Sun, 21 May 2006 13:05:25 GMT NNTP-Posting-Host: 82.10.238.153 X-Trace: newsfe2-gui.ntli.net 1148216725 82.10.238.153 (Sun, 21 May 2006 14:05:25 BST) NNTP-Posting-Date: Sun, 21 May 2006 14:05:25 BST Organization: NTL Xref: g2news2.google.com comp.lang.ada:4317 Date: 2006-05-21T13:05:25+00:00 List-Id: 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