diff mbox

[v2] ia64: don't use dynamic relocations for local symbols

Message ID 20160102115056.0ffe0fba@sf
State New
Headers show

Commit Message

Sergei Trofimovich Jan. 2, 2016, 11:50 a.m. UTC
On Sat, 2 Jan 2016 00:30:58 -0700
Jeff Law <law@redhat.com> wrote:

> > That way gcc will be able to compile glibc's ld: PR/60465
> Egad. PIC on ia64 is a mess. I can kind of see what Richard was trying 
> to do, but ewww. I don't think it's worth the effort to deep dive into 
> the PIC support and make ia64 handle things like most other ports -- 
> it's a dead architecture so ISTM the easiest fix is the right fix.
> 
> A few, relatively minor things.

> > diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
> > index f48cebc..6ea5072 100644
> > --- a/gcc/config/ia64/ia64.c
> > +++ b/gcc/config/ia64/ia64.c
> > @@ -1105,6 +1105,8 @@ ia64_expand_load_address (rtx dest, rtx src)
> >       emit_insn (gen_load_fptr (dest, src));
> >     else if (sdata_symbolic_operand (src, VOIDmode))
> >       emit_insn (gen_load_gprel (dest, src));
> > +  else if (local_symbolic_operand64 (src, VOIDmode))
> > +    emit_insn (gen_load_gprel64 (dest, src));
> Comment here.  Something like
> 
> /* We want to use gprel rather than ltoff relocations for
>     local symbolic operands.  */
Done. Hope not too wordy :)

> 
> >
> > +;; True if OP refers to a local symbol +any large offset).
> ;; True if OP refers to a local symbol [+ any offset ]
> 
> I haven't dug into the ia64 port (and I'm not planning to) to see if/how 
> it MINUS in symbolic expressions.  It's been the source of problems in 
> various ports trough the years.
> 
> Can you take the testcase from your post as well as the one from BZ60465 
> comment #37 (from you) and add them to the testsuite?
Added both tests.

> Note you're not running the full testsuite, just a few dozen ia64 
> specific tests, which will include your new tests.  ANd you're not 
> rebuilding the whole compiler between those steps, just ia64.o and 
> relinking the compiler.  So it ought to be reasonably fast.
> 
> So to summarize, I think your patch needs the two trivial comment fixes 
> noted above, 2 testcases and the before/after results of running just 
> the ia64.exp tests.  Repost with that and I'll get it into the tree.


I did ran tests only on amd64 host thus the execution failure tests.

Attached updated patch and test runs on a crosscompiler before
and after the change.

Now I'm building on real ia64 hardware as
    make bootstrap
    make -k check

for both clean and patched trees.

Comments

Sergei Trofimovich Jan. 5, 2016, 9:18 a.m. UTC | #1
On Sat, 2 Jan 2016 11:50:56 +0000
Sergei Trofimovich <slyfox@inbox.ru> wrote:

> Attached updated patch and test runs on a crosscompiler before
> and after the change.
> 
> Now I'm building on real ia64 hardware as
>     make bootstrap
>     make -k check
> 
> for both clean and patched trees.

'make bootstrap' works fine on ia64 but I've failed to run 'make check'.
Testsuite's LD_LIBRARY_PATHs are not correct and can run tests.

Executing on host: /root/gcc-build/gcc/xgcc -B/root/gcc-build/gcc/  -fno-diagnostics-show-caret -fdiagnostics-color=never    -O0  -w -c   -o 20000105-1.o /root/gcc/gcc/testsuite/gcc.c-torture/compile/20000105-1.c    (timeout = 300)
spawn /root/gcc-build/gcc/xgcc -B/root/gcc-build/gcc/ -fno-diagnostics-show-caret -fdiagnostics-color=never -O0 -w -c -o 200001
05-1.o /root/gcc/gcc/testsuite/gcc.c-torture/compile/20000105-1.c
compiler exited with status -1
output is:
spawn failed

But running builds manually works:

gcc-build # /root/gcc-build/gcc/xgcc -B/root/gcc-build/gcc/  -fno-diagnostics-show-caret -fdiagnostics-color=never    -O0  -w -c   -o 20000105-1.o /root/gcc/gcc/testsuite/gcc.c-torture/compile/20000105-1.c  && echo ok
ok
Eric Botcazou Jan. 5, 2016, 9:39 a.m. UTC | #2
> 'make bootstrap' works fine on ia64 but I've failed to run 'make check'.
> Testsuite's LD_LIBRARY_PATHs are not correct and can run tests.

You need to run 'make -k check' from the top level build directory.
Jeff Law Jan. 5, 2016, 5:41 p.m. UTC | #3
On 01/05/2016 02:39 AM, Eric Botcazou wrote:
>> 'make bootstrap' works fine on ia64 but I've failed to run 'make check'.
>> Testsuite's LD_LIBRARY_PATHs are not correct and can run tests.
>
> You need to run 'make -k check' from the top level build directory.
No worries.  I had an ia64 box provisioned when I looked at this and I 
just let it run the regression tests overnight.  Everything looks good.

jeff
Jeff Law Jan. 5, 2016, 5:59 p.m. UTC | #4
On 01/02/2016 04:50 AM, Sergei Trofimovich wrote:
>>
> I did ran tests only on amd64 host thus the execution failure tests.
>
> Attached updated patch and test runs on a crosscompiler before
> and after the change.
>
> Now I'm building on real ia64 hardware as
>      make bootstrap
>      make -k check
>
> for both clean and patched trees.
Thanks.  I also did a bootstrap & regression test since I had an ia64 
box provisioned when I was poking at your patch.

I've installed your patch on the trunk.
jeff
Sergei Trofimovich Jan. 5, 2016, 10:26 p.m. UTC | #5
On Tue, 5 Jan 2016 10:41:14 -0700
Jeff Law <law@redhat.com> wrote:

> On 01/05/2016 02:39 AM, Eric Botcazou wrote:
> >> 'make bootstrap' works fine on ia64 but I've failed to run 'make check'.
> >> Testsuite's LD_LIBRARY_PATHs are not correct and can run tests.
> >
> > You need to run 'make -k check' from the top level build directory.
> No worries.  I had an ia64 box provisioned when I looked at this and I 
> just let it run the regression tests overnight.  Everything looks good.
> 
> jeff

Thank you!

[ Also found real cause of broken 'make -k check':
  I did not have devpts subsystem set correctly.
  Expect requires pseudoterminals to really work.
  Fixed that and tests run fine now. ]
diff mbox

Patch

--- ia64-before.log     2016-01-02 11:20:21.000000000 +0000
+++ ia64-after.log      2016-01-02 11:22:37.000000000 +0000
@@ -1 +1 @@ 
-Test Run By slyfox on Sat Jan  2 11:19:38 2016
+Test Run By slyfox on Sat Jan  2 11:22:16 2016
@@ -26,2 +25,0 @@ 
-FAIL: gcc.target/ia64/pr60465-gprel64-c37.c scan-assembler-not @ltoffx
-FAIL: gcc.target/ia64/pr60465-gprel64.c scan-assembler-not @ltoffx
@@ -31,2 +29,2 @@ 
-# of expected passes            147
-# of unexpected failures        11
+# of expected passes            149
+# of unexpected failures        9