Message ID | 20100614150504.GA7590@adacore.com |
---|---|
State | New |
Headers | show |
On Mon, Jun 14, 2010 at 5:05 PM, Arnaud Charlet <charlet@adacore.com> wrote: [...] For some reason this batch of changes caused parallel bootstrap on x86_64 to fail for me with linker errors linking the RTS complaining about x86_64_32 relocs and missing -fPIC. A rm gcc/ada/rts/*.o and a build re-start gets me past this error. Richard.
On Tue, Jun 15, 2010 at 11:31 AM, Richard Guenther <richard.guenther@gmail.com> wrote: > On Mon, Jun 14, 2010 at 5:05 PM, Arnaud Charlet <charlet@adacore.com> wrote: > [...] > > For some reason this batch of changes caused parallel bootstrap > on x86_64 to fail for me with linker errors linking the RTS complaining > about x86_64_32 relocs and missing -fPIC. A rm gcc/ada/rts/*.o and > a build re-start gets me past this error. For reference: touch ../stamp-gnatlib-rts make[6]: Leaving directory `/home/abuild/rguenther/obj/gcc/ada' rm -f rts/libgna*.so cd rts; ../../xgcc -B../../ -shared -g -O2 \ -fPIC \ -o libgnat-4.5.so \ a-assert.o a-calari.o a-calcon.o a-caldel.o a-calend.o ... seh_init.o cal.o arit64.o final.o tracebak.o expect.o mkdir.o socket.o targext.o raise-gcc.o \ -Wl,-soname,libgnat-4.5.so \ -lm /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: a-assert.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC a-assert.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[5]: *** [gnatlib-shared-default] Error 1 make[5]: Leaving directory `/home/abuild/rguenther/obj/gcc/ada' make[4]: *** [gnatlib-shared-dual] Error 2 make[4]: Leaving directory `/home/abuild/rguenther/obj/gcc/ada' make[3]: *** [gnatlib-shared] Error 2 make[3]: Leaving directory `/home/abuild/rguenther/obj/gcc/ada' make[2]: *** [gnatlib-shared] Error 2 make[2]: Leaving directory `/home/abuild/rguenther/obj/x86_64-unknown-linux-gnu/libada' make[1]: *** [all-target-libada] Error 2 make[1]: Leaving directory `/home/abuild/rguenther/obj' make: *** [all] Error 2 > Richard. >
> For some reason this batch of changes caused parallel bootstrap > on x86_64 to fail for me with linker errors linking the RTS complaining > about x86_64_32 relocs and missing -fPIC. A rm gcc/ada/rts/*.o and > a build re-start gets me past this error. I suspect this is a latent bug in the Makefile, unrelated to my changes. FWIW, I always do a rm -f x86_64-unknown-linux-gnu/libada/stamp-libada gcc/stamp-* before starting a build, since since timestamp business simply does not work in my experience and causes all kinds of troubles (such as the one you've experienced I suspect). Arno
On Tue, Jun 15, 2010 at 11:45 AM, Arnaud Charlet <charlet@adacore.com> wrote: >> For some reason this batch of changes caused parallel bootstrap >> on x86_64 to fail for me with linker errors linking the RTS complaining >> about x86_64_32 relocs and missing -fPIC. A rm gcc/ada/rts/*.o and >> a build re-start gets me past this error. > > I suspect this is a latent bug in the Makefile, unrelated to my changes. > FWIW, I always do a > > rm -f x86_64-unknown-linux-gnu/libada/stamp-libada gcc/stamp-* > > before starting a build, since since timestamp business simply does not > work in my experience and causes all kinds of troubles (such as the one > you've experienced I suspect). Oh, this is clean bootstraps from an empty object directory, not some fancy re-builds. I'm currently trying to reproduce on another machine, just to make sure ... > Arno >
On Tue, Jun 15, 2010 at 11:47 AM, Richard Guenther <richard.guenther@gmail.com> wrote: > On Tue, Jun 15, 2010 at 11:45 AM, Arnaud Charlet <charlet@adacore.com> wrote: >>> For some reason this batch of changes caused parallel bootstrap >>> on x86_64 to fail for me with linker errors linking the RTS complaining >>> about x86_64_32 relocs and missing -fPIC. A rm gcc/ada/rts/*.o and >>> a build re-start gets me past this error. >> >> I suspect this is a latent bug in the Makefile, unrelated to my changes. >> FWIW, I always do a >> >> rm -f x86_64-unknown-linux-gnu/libada/stamp-libada gcc/stamp-* >> >> before starting a build, since since timestamp business simply does not >> work in my experience and causes all kinds of troubles (such as the one >> you've experienced I suspect). > > Oh, this is clean bootstraps from an empty object directory, not some > fancy re-builds. I'm currently trying to reproduce on another machine, > just to make sure ... It seems this is caused by a local patch of mine - weird, this will be fun to track down. Sorry for the noise. Richard.
> It seems this is caused by a local patch of mine - weird, this will be > fun to track down. > > Sorry for the noise. OK, no problem. The issues I mentioned are indeed related to incremental builds, a build from scratch should of course always work. Arno
Index: sem_ch3.adb =================================================================== --- sem_ch3.adb (revision 160731) +++ sem_ch3.adb (working copy) @@ -3750,10 +3750,10 @@ if Present (Generic_Parent_Type (N)) and then (Nkind - (Parent (Generic_Parent_Type (N))) /= N_Formal_Type_Declaration + (Parent (Generic_Parent_Type (N))) /= N_Formal_Type_Declaration or else Nkind (Formal_Type_Definition (Parent (Generic_Parent_Type (N)))) - /= N_Formal_Private_Type_Definition) + /= N_Formal_Private_Type_Definition) then if Is_Tagged_Type (Id) then @@ -7356,6 +7356,27 @@ Exclude_Parents => True); Set_Interfaces (Derived_Type, Ifaces_List); + + -- If the derived type is the anonymous type created for + -- a declaration whose parent has a constraint, propagate + -- the interface list to the source type. This must be done + -- prior to the completion of the analysis of the source type + -- because the components in the extension may contain current + -- instances whose legality depends on some ancestor. + + if Is_Itype (Derived_Type) then + declare + Def : constant Node_Id := + Associated_Node_For_Itype (Derived_Type); + begin + if Present (Def) + and then Nkind (Def) = N_Full_Type_Declaration + then + Set_Interfaces + (Defining_Identifier (Def), Ifaces_List); + end if; + end; + end if; end; end if; Index: exp_disp.adb =================================================================== --- exp_disp.adb (revision 160705) +++ exp_disp.adb (working copy) @@ -1528,14 +1528,19 @@ Formal := First (Formals); while Present (Formal) loop - -- Handle concurrent types + -- Handle concurrent types. if Ekind (Target_Formal) = E_In_Parameter and then Ekind (Etype (Target_Formal)) = E_Anonymous_Access_Type then Ftyp := Directly_Designated_Type (Etype (Target_Formal)); else - Ftyp := Etype (Target_Formal); + + -- if the parent is a constrained discriminated type. the + -- primitive operation will have been defined on a first subtype. + -- for proper matching with controlling type, use base type. + + Ftyp := Base_Type (Etype (Target_Formal)); end if; if Is_Concurrent_Type (Ftyp) then