diff mbox

[ada] Support 64-bit libgnat multilib on i?86-linux

Message ID yddehw8qsxx.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Dec. 13, 2011, 5:31 p.m. UTC
I recently set up a bi-arch environment on i686-unknown-linux-gnu with
--enable-targets=all to check which of a couple of problems I'm seeing
on i386-pc-solaris2.1? are Solaris specific and which are generic.  When
trying to bootstrap such a compiler with all languages, Ada bootstrap
failed compiling the 64-bit libada:

$ /var/gcc/regression/trunk/2.6.18-gcc-gas-gld-32/build/./gcc/xgcc -B/var/gcc/regression/trunk/2.6.18-gcc-gas-gld-32/build/./gcc/ -B/vol/gcc/i686-unknown-linux-gnu/bin/ -B/vol/gcc/i686-unknown-linux-gnu/lib/ -isystem /vol/gcc/i686-unknown-linux-gnu/include -isystem /vol/gcc/i686-unknown-linux-gnu/sys-include    -c -g -O2 -m64 -fpic  -W -Wall -gnatpg -nostdinc -m64  a-finali.adb -o a-finali.o
a-finali.ads:64:09: alignment for "Controlledb64s" must be at least 8
a-finali.ads:64:09: alignment for "Controlledr62s" must be at least 8
a-finali.ads:64:09: alignment for "Controlledt59s" must be at least 8
a-finali.ads:70:09: alignment for "Limited_Controlledb98s" must be at least 8
a-finali.ads:70:09: alignment for "Limited_Controlledr96s" must be at least 8
a-finali.ads:70:09: alignment for "Limited_Controlledt93s" must be at least 8

It turned out that this configuration incorrectly used
system-linux-x86.ads for both multilibs.  The following patch fixes this
and allowed (together with a libffi and libjava patch to be submitted
shortly) the bootstrap to complete.

Ok for mainline?

	Rainer


2011-12-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc-interface/Makefile.in (%86 linux%):
	(LIBGNAT_TARGET_PAIRS_32): Split off from LIBGNAT_TARGET_PAIRS.
	(LIBGNAT_TARGET_PAIRS_64): New.
	(LIBGNAT_TARGET_PAIRS): Add either depending on multilib.

Comments

Eric Botcazou Dec. 19, 2011, 7:25 p.m. UTC | #1
> 2011-12-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* gcc-interface/Makefile.in (%86 linux%):
> 	(LIBGNAT_TARGET_PAIRS_32): Split off from LIBGNAT_TARGET_PAIRS.
> 	(LIBGNAT_TARGET_PAIRS_64): New.
> 	(LIBGNAT_TARGET_PAIRS): Add either depending on multilib.

OK, thanks.  You can also backport it to 4.6 and 4.5 branches if you want.
Rainer Orth Dec. 20, 2011, 1:09 p.m. UTC | #2
Eric Botcazou <ebotcazou@adacore.com> writes:

>> 2011-12-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>> 	* gcc-interface/Makefile.in (%86 linux%):
>> 	(LIBGNAT_TARGET_PAIRS_32): Split off from LIBGNAT_TARGET_PAIRS.
>> 	(LIBGNAT_TARGET_PAIRS_64): New.
>> 	(LIBGNAT_TARGET_PAIRS): Add either depending on multilib.
>
> OK, thanks.  You can also backport it to 4.6 and 4.5 branches if you want.

Probably not: I only test my own targets on branches for lack of time.

Thanks.
        Rainer
diff mbox

Patch

diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -1102,9 +1102,21 @@  ifeq ($(strip $(filter-out %86 linux%,$(
   a-exetim.ads<a-exetim-default.ads \
   s-linux.ads<s-linux.ads \
   s-osinte.adb<s-osinte-posix.adb \
-  system.ads<system-linux-x86.ads \
-  $(ATOMICS_TARGET_PAIRS) \
-  $(X86_TARGET_PAIRS)
+  $(ATOMICS_TARGET_PAIRS)
+
+  LIBGNAT_TARGET_PAIRS_32 = \
+  $(X86_TARGET_PAIRS) \
+  system.ads<system-linux-x86.ads
+
+  LIBGNAT_TARGET_PAIRS_64 = \
+  $(X86_64_TARGET_PAIRS) \
+  system.ads<system-linux-x86_64.ads
+
+  ifeq ($(strip $(MULTISUBDIR)),/64)
+    LIBGNAT_TARGET_PAIRS += $(LIBGNAT_TARGET_PAIRS_64)
+  else
+    LIBGNAT_TARGET_PAIRS += $(LIBGNAT_TARGET_PAIRS_32)
+  endif
 
   ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
     LIBGNAT_TARGET_PAIRS += \