[Ada] multilib patch take two => multilib build working

Laurent GUERBY laurent@guerby.net
Tue Jul 22 11:29:00 GMT 2008


The attached patch enables Ada multilib build on x86_64-linux. It does
not yet install and use the 32 bit libada which is built during
bootstrap however so user still has to use -aO flag for gnatmake to
work.

The patch touches lots of gcc/ada/Makefile.in but hopefully 99% of the
change is mechanical:

1/ replace all use of "rts" by "$(RTSDIR)"
2/ replace all use of "stamp-gnatlib*" by "stamp-gnatlib*-$(RTSDIR)"

Once these changes are in place by setting RTSDIR one can build
multiple Ada rts without conflict from gcc/ada/Makefile.in. Which is
done by libada/Makefile.in passing additional arguments to make gnatlib.
multilib magic does the rest.

I had to solve one rts source issue though:
gcc/ada/system-linux-x86_64.ads and x86.ads do hardcode the number of
bits for a word (64 and 32 respectively), I changed them both to be
completely the same and use GNAT defined Standard'Word_Size attribute.

-   Word_Size    : constant := 64;
-   Memory_Size  : constant := 2 ** 64;
+   Word_Size    : constant := Standard'Word_Size;
+   Memory_Size  : constant := 2 ** Word_Size;

The same change will have to be done on other 32/64 bits Ada targets. I
don't know if this change has adverse effect on GNAT build in some
situations.

The patch is not complete yet of course but I'd appreciate feedback on
wether or not I'm on the right track for 4.4 inclusion.

Thanks in advance,

Laurent

guerby@gcc17:~/tmp$ PATH=/home/guerby/install-trunk-mlib7/bin:$PATH
guerby@gcc17:~/tmp$ cat p.adb
procedure p is begin null; end p;
guerby@gcc17:~/tmp$ gnatmake -f -g p
gcc -c -g p.adb
gnatbind -x p.ali
gnatlink p.ali -g
guerby@gcc17:~/tmp$ file ./p
./p: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/Linux 2.6.0, not stripped
guerby@gcc17:~/tmp$ gnatmake -f -g -aO/home/guerby/build-mlib7/gcc/ada/rts32 -m32 p
gcc -c -g -m32 p.adb
gnatbind -aO/home/guerby/build-mlib7/gcc/ada/rts32 -x p.ali
gnatlink p.ali -g -m32
guerby@gcc17:~/tmp$ file ./p
./p: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/Linux 2.6.0, not stripped


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ada-multilib-patch-v4
Type: text/x-patch
Size: 63593 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20080722/1cb7d476/attachment.bin>


More information about the Gcc mailing list