public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
@ 2011-05-02  7:21 Uros Bizjak
  2014-07-26 16:12 ` Uros Bizjak
  0 siblings, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2011-05-02  7:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

Hello!

It looks that GP relative relocations do not fit anymore into GPREL16
reloc, so bootstrap on alpha hosts fail in stage2 with  "relocation
truncated to fit: GPREL16 against ...". I found no other solution but
to pass --no-relax to linker in order to finish the bootstrap.

2011-05-02  Uros Bizjak  <ubizjak@gmail.com>

	PR target/47230
	* configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
	* configure: Regenerate.

config/ChangeLog:

2011-05-02  Uros Bizjak  <ubizjak@gmail.com>

	PR target/47230
	* mh-alpha-linux: New file.

Patch was bootstrapped and regression tested with "GNU ld (GNU
Binutils) 2.21" on alphaev68-pc-linux-gnu [1].

OK for 4.6. and 4.7 ?

[1] http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00089.html

Uros.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 1072 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 173233)
+++ configure.ac	(working copy)
@@ -1100,6 +1100,9 @@
   *-interix*)
     host_makefile_frag="config/mh-interix"
     ;;
+  alpha*-*-linux*)
+    host_makefile_frag="config/mh-alpha-linux"
+    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: configure
===================================================================
--- configure	(revision 173233)
+++ configure	(working copy)
@@ -3672,6 +3672,9 @@
   *-interix*)
     host_makefile_frag="config/mh-interix"
     ;;
+  alpha*-*-linux*)
+    host_makefile_frag="config/mh-alpha-linux"
+    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: config/mh-alpha-linux
===================================================================
--- config/mh-alpha-linux	(revision 0)
+++ config/mh-alpha-linux	(revision 0)
@@ -0,0 +1,3 @@
+# Prevent GPREL16 relocation truncation
+LDFLAGS += -Wl,--no-relax
+BOOT_LDFLAGS += -Wl,--no-relax

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2011-05-02  7:21 [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..." Uros Bizjak
@ 2014-07-26 16:12 ` Uros Bizjak
  2014-07-28 17:02   ` Richard Henderson
  0 siblings, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2014-07-26 16:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Mon, May 2, 2011 at 9:21 AM, Uros Bizjak <ubizjak@gmail.com> wrote:

> It looks that GP relative relocations do not fit anymore into GPREL16
> reloc, so bootstrap on alpha hosts fail in stage2 with  "relocation
> truncated to fit: GPREL16 against ...". I found no other solution but
> to pass --no-relax to linker in order to finish the bootstrap.
>
> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>
>         PR target/47230
>         * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
>         * configure: Regenerate.
>
> config/ChangeLog:
>
> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>
>         PR target/47230
>         * mh-alpha-linux: New file.
>
> Patch was bootstrapped and regression tested with "GNU ld (GNU
> Binutils) 2.21" on alphaev68-pc-linux-gnu [1].
>
> OK for 4.6. and 4.7 ?
>
> [1] http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00089.html

Patch was committed to mainline SVN, 4.9 and 4.8 branches.

Uros.

[-- Attachment #2: b.diff.txt --]
[-- Type: text/plain, Size: 1072 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 173233)
+++ configure.ac	(working copy)
@@ -1100,6 +1100,9 @@
   *-interix*)
     host_makefile_frag="config/mh-interix"
     ;;
+  alpha*-*-linux*)
+    host_makefile_frag="config/mh-alpha-linux"
+    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: configure
===================================================================
--- configure	(revision 173233)
+++ configure	(working copy)
@@ -3672,6 +3672,9 @@
   *-interix*)
     host_makefile_frag="config/mh-interix"
     ;;
+  alpha*-*-linux*)
+    host_makefile_frag="config/mh-alpha-linux"
+    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: config/mh-alpha-linux
===================================================================
--- config/mh-alpha-linux	(revision 0)
+++ config/mh-alpha-linux	(revision 0)
@@ -0,0 +1,3 @@
+# Prevent GPREL16 relocation truncation
+LDFLAGS += -Wl,--no-relax
+BOOT_LDFLAGS += -Wl,--no-relax

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2014-07-26 16:12 ` Uros Bizjak
@ 2014-07-28 17:02   ` Richard Henderson
  2014-07-29 16:23     ` Uros Bizjak
  2015-02-25 19:18     ` Uros Bizjak
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Henderson @ 2014-07-28 17:02 UTC (permalink / raw)
  To: Uros Bizjak, gcc-patches

On 07/26/2014 05:35 AM, Uros Bizjak wrote:
> On Mon, May 2, 2011 at 9:21 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> 
>> It looks that GP relative relocations do not fit anymore into GPREL16
>> reloc, so bootstrap on alpha hosts fail in stage2 with  "relocation
>> truncated to fit: GPREL16 against ...". I found no other solution but
>> to pass --no-relax to linker in order to finish the bootstrap.
>>
>> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>>
>>         PR target/47230
>>         * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
>>         * configure: Regenerate.
>>
>> config/ChangeLog:
>>
>> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>>
>>         PR target/47230
>>         * mh-alpha-linux: New file.
>>
>> Patch was bootstrapped and regression tested with "GNU ld (GNU
>> Binutils) 2.21" on alphaev68-pc-linux-gnu [1].
>>
>> OK for 4.6. and 4.7 ?
>>
>> [1] http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00089.html
> 
> Patch was committed to mainline SVN, 4.9 and 4.8 branches.

FYI, this was a bug in ld that I fixed "recently", i.e. after the current 2.24
release.  It's an ok workaround for release branches, but I'd like it not to be
committed to mainline please.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2014-07-28 17:02   ` Richard Henderson
@ 2014-07-29 16:23     ` Uros Bizjak
  2014-07-29 16:56       ` Richard Henderson
  2015-02-25 19:18     ` Uros Bizjak
  1 sibling, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2014-07-29 16:23 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Mon, Jul 28, 2014 at 7:02 PM, Richard Henderson <rth@redhat.com> wrote:
> On 07/26/2014 05:35 AM, Uros Bizjak wrote:
>> On Mon, May 2, 2011 at 9:21 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>
>>> It looks that GP relative relocations do not fit anymore into GPREL16
>>> reloc, so bootstrap on alpha hosts fail in stage2 with  "relocation
>>> truncated to fit: GPREL16 against ...". I found no other solution but
>>> to pass --no-relax to linker in order to finish the bootstrap.
>>>
>>> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>>>
>>>         PR target/47230
>>>         * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
>>>         * configure: Regenerate.
>>>
>>> config/ChangeLog:
>>>
>>> 2011-05-02  Uros Bizjak  <ubizjak@gmail.com>
>>>
>>>         PR target/47230
>>>         * mh-alpha-linux: New file.
>>>
>>> Patch was bootstrapped and regression tested with "GNU ld (GNU
>>> Binutils) 2.21" on alphaev68-pc-linux-gnu [1].
>>>
>>> OK for 4.6. and 4.7 ?
>>>
>>> [1] http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00089.html
>>
>> Patch was committed to mainline SVN, 4.9 and 4.8 branches.
>
> FYI, this was a bug in ld that I fixed "recently", i.e. after the current 2.24
> release.  It's an ok workaround for release branches, but I'd like it not to be
> committed to mainline please.

Perhaps even better solution for mainline would be to detect a recent
enough linker and skip the workaround in that case? I guess that 2.25
will have this issue fixed?

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2014-07-29 16:23     ` Uros Bizjak
@ 2014-07-29 16:56       ` Richard Henderson
  2014-07-29 19:53         ` Uros Bizjak
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2014-07-29 16:56 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On 07/29/2014 06:11 AM, Uros Bizjak wrote:
> Perhaps even better solution for mainline would be to detect a recent
> enough linker and skip the workaround in that case? I guess that 2.25
> will have this issue fixed?

Certainly 2.25 will have this fixed.  If you want to add a check for binutils
version number, I'm ok with that.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2014-07-29 16:56       ` Richard Henderson
@ 2014-07-29 19:53         ` Uros Bizjak
  0 siblings, 0 replies; 15+ messages in thread
From: Uros Bizjak @ 2014-07-29 19:53 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Tue, Jul 29, 2014 at 6:39 PM, Richard Henderson <rth@redhat.com> wrote:
> On 07/29/2014 06:11 AM, Uros Bizjak wrote:
>> Perhaps even better solution for mainline would be to detect a recent
>> enough linker and skip the workaround in that case? I guess that 2.25
>> will have this issue fixed?
>
> Certainly 2.25 will have this fixed.  If you want to add a check for binutils
> version number, I'm ok with that.

Unfortunately, checking for host tools version won't work, since
host_makefile_frag is substituted earlier that substitution for host
CC (and LD).

I propose to add a ??? comment to the configure, such as:

-- cut here --
Index: configure
===================================================================
--- configure   (revision 213081)
+++ configure   (working copy)
@@ -3879,6 +3879,7 @@
     host_makefile_frag="config/mh-mingw"
     ;;
   alpha*-*-linux*)
+    # ??? Remove for GNU ld version 2.25 and higher.
     host_makefile_frag="config/mh-alpha-linux"
     ;;
   hppa*-hp-hpux10*)
Index: configure.ac
===================================================================
--- configure.ac        (revision 213081)
+++ configure.ac        (working copy)
@@ -1178,6 +1178,7 @@
     host_makefile_frag="config/mh-mingw"
     ;;
   alpha*-*-linux*)
+    # ??? Remove for GNU ld version 2.25 and higher.
     host_makefile_frag="config/mh-alpha-linux"
     ;;
   hppa*-hp-hpux10*)
-- cut here --

and remove this fragment after binutils 2.25 is released. After the
release, we can comment out referred line in configure, document the
requirement for binutils >= 2.25 in install.texi and document the
workaround, which will be to un-comment the relevant line in configure
file.

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2014-07-28 17:02   ` Richard Henderson
  2014-07-29 16:23     ` Uros Bizjak
@ 2015-02-25 19:18     ` Uros Bizjak
  2015-02-25 19:35       ` Richard Henderson
  1 sibling, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2015-02-25 19:18 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]

On Mon, Jul 28, 2014 at 7:02 PM, Richard Henderson <rth@redhat.com> wrote:
> On 07/26/2014 05:35 AM, Uros Bizjak wrote:
>> On Mon, May 2, 2011 at 9:21 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>
>>> It looks that GP relative relocations do not fit anymore into GPREL16
>>> reloc, so bootstrap on alpha hosts fail in stage2 with  "relocation
>>> truncated to fit: GPREL16 against ...". I found no other solution but
>>> to pass --no-relax to linker in order to finish the bootstrap.

[...]

> FYI, this was a bug in ld that I fixed "recently", i.e. after the current 2.24
> release.  It's an ok workaround for release branches, but I'd like it not to be
> committed to mainline please.

Attached patch reverts PR47230 workaround on mainline SVN. In addition
to the revert, the patch also documents that binutils 2.25 or newer
are required.

/

2015-02-25  Uros Bizjak  <ubizjak@gmail.com>

    Revert:
    2014-07-26  Uros Bizjak  <ubizjak@gmail.com>

    PR target/47230
    * configure.ac (alpha*-*-linux*): Use mh-alpha-linux.
    * configure: Regenerate.

/config

2015-02-25  Uros Bizjak  <ubizjak@gmail.com>

    Revert:
    2014-07-26  Uros Bizjak  <ubizjak@gmail.com>

    PR target/47230
    * mh-alpha-linux: New file.

/gcc

2015-02-25  Uros Bizjak  <ubizjak@gmail.com>

    PR target/47230
    * doc/install.texi (Specific, alpha*-*-*): Document that binutils 2.25
    or newer are required.

The patch was tested on alpha-linux-gnu and alphaev68-linux-gnu for
all default languages plus obj-c++ and go.

OK for mainline?

Uros.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 1926 bytes --]

Index: config/mh-alpha-linux
===================================================================
--- config/mh-alpha-linux	(revision 220920)
+++ config/mh-alpha-linux	(working copy)
@@ -1,3 +0,0 @@
-# Prevent GPREL16 relocation truncation
-LDFLAGS += -Wl,--no-relax
-BOOT_LDFLAGS += -Wl,--no-relax
Index: configure
===================================================================
--- configure	(revision 220920)
+++ configure	(working copy)
@@ -3944,9 +3944,6 @@
   *-mingw*)
     host_makefile_frag="config/mh-mingw"
     ;;
-  alpha*-*-linux*)
-    host_makefile_frag="config/mh-alpha-linux"
-    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: configure.ac
===================================================================
--- configure.ac	(revision 220920)
+++ configure.ac	(working copy)
@@ -1275,9 +1275,6 @@
   *-mingw*)
     host_makefile_frag="config/mh-mingw"
     ;;
-  alpha*-*-linux*)
-    host_makefile_frag="config/mh-alpha-linux"
-    ;;
   hppa*-hp-hpux10*)
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(revision 220920)
+++ gcc/doc/install.texi	(working copy)
@@ -3416,10 +3416,11 @@
 DEC OSF/1, Digital UNIX and Tru64 UNIX)@.  In addition to reading this
 section, please read all other sections that match your target.
 
-We require binutils 2.11.2 or newer.
-Previous binutils releases had a number of problems with DWARF 2
-debugging information, not the least of which is incorrect linking of
-shared libraries.
+Binutils 2.25 or newer are required.
+Versions prior to 2.25 have faulty relaxation pass that may result in
+GPREL16 relocation truncation errors.  Versions prior to 2.11.2 had a
+number of problems with DWARF 2 debugging information, not the least of
+which is incorrect linking of shared libraries.
 
 @html
 <hr />

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-02-25 19:18     ` Uros Bizjak
@ 2015-02-25 19:35       ` Richard Henderson
  2015-02-27 13:35         ` Uros Bizjak
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2015-02-25 19:35 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On 02/25/2015 09:02 AM, Uros Bizjak wrote:
> The patch was tested on alpha-linux-gnu and alphaev68-linux-gnu for
> all default languages plus obj-c++ and go.
> 
> OK for mainline?

Ok.  Thanks.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-02-25 19:35       ` Richard Henderson
@ 2015-02-27 13:35         ` Uros Bizjak
  2015-03-02 18:24           ` Richard Henderson
  2015-03-04 13:56           ` Uros Bizjak
  0 siblings, 2 replies; 15+ messages in thread
From: Uros Bizjak @ 2015-02-27 13:35 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Wed, Feb 25, 2015 at 8:18 PM, Richard Henderson <rth@redhat.com> wrote:
> On 02/25/2015 09:02 AM, Uros Bizjak wrote:
>> The patch was tested on alpha-linux-gnu and alphaev68-linux-gnu for
>> all default languages plus obj-c++ and go.
>>
>> OK for mainline?
>
> Ok.  Thanks.

Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
and alphaev68-linux-gnu, the bootstrap still fails when configured
--with-build-config=bootstrap-lto:

libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1d0):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function
`compute_overlap_steps_for_affine_1_2':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72a8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72b4):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function `analyze_siv_subscript_cst_affine':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a5c):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a74):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bc0):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bd8):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8db8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8dd0):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function
`dr_analyze_innermost(data_reference*, loop*)':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:802:(.text+0xb54c):
additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
../../gcc-svn/trunk/gcc/lto/Make-lang.in:71: recipe for target 'lto1' failed
gmake[3]: *** [lto1] Error 1

Also reported is build failure on debian [1], where bootstrap dies
with ELF_LITERAL truncation:

libbackend.a(tree-vect-generic.o): In function `gimple_statement_structure':
/«PKGBUILDDIR»/build/gcc/../../src/gcc/gimple.h:1572:(.text+0x2f4):
relocation truncated to fit: ELF_LITERAL against `.text'
libbackend.a(tree-vect-generic.o): In function `gimple_has_ops':
/«PKGBUILDDIR»/build/gcc/../../src/gcc/gimple.h:1846:(.text+0x38c):
relocation truncated to fit: ELF_LITERAL against `.text'
/«PKGBUILDDIR»/build/gcc/../../src/gcc/gimple.h:1846:(.text+0x3ac):
relocation truncated to fit: ELF_LITERAL against `.text'

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=5276#c13

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-02-27 13:35         ` Uros Bizjak
@ 2015-03-02 18:24           ` Richard Henderson
  2015-03-03 14:14             ` Uros Bizjak
  2015-03-04 13:56           ` Uros Bizjak
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2015-03-02 18:24 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Michael Cree

On 02/27/2015 05:11 AM, Uros Bizjak wrote:
> On Wed, Feb 25, 2015 at 8:18 PM, Richard Henderson <rth@redhat.com> wrote:
>> On 02/25/2015 09:02 AM, Uros Bizjak wrote:
>>> The patch was tested on alpha-linux-gnu and alphaev68-linux-gnu for
>>> all default languages plus obj-c++ and go.
>>>
>>> OK for mainline?
>>
>> Ok.  Thanks.
> 
> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
> and alphaev68-linux-gnu, the bootstrap still fails when configured
> --with-build-config=bootstrap-lto:
> 
> libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)

Interesting.  And using bootstrap-lto works with --no-relax?  I don't believe
I've ever tried it...

> Also reported is build failure on debian [1], where bootstrap dies
> with ELF_LITERAL truncation:
> 
> libbackend.a(tree-vect-generic.o): In function `gimple_statement_structure':
> /«PKGBUILDDIR»/build/gcc/../../src/gcc/gimple.h:1572:(.text+0x2f4):
> relocation truncated to fit: ELF_LITERAL against `.text'

I strongly suspect this is something else.  Since the error message still
includes ELF_LITERAL, I can't imagine that relaxation is involved at all.

This kind of error message is typically associated with object files that
contain more than 8k unique got references, i.e. they exceed the 64k
addressable got subsegment available to each input object file.

Generally I see this error when projects do "ld -r" to combine all of the
object files before final link.  At which point I have to shrug and say "don't
do that".

But I could imagine that LTO could have the same net effect on Alpha, if we
create too few partitions (and thus too few intermedate object files) and
somehow had too many symbol references that remain "non-local", i.e. aren't
emitted as GPRELHIGH+GPRELLOW pairs at compile-time.

Of course, I would also expect that LTO would allow the compiler to see that
99% of all symbols in the application are local, and thus avoid using LITERAL
relocations in the first place.  The fact that we've got a LITERAL relocation
against ".text" here is particularly suspicious.

It would be illuminating to examine the intermediate object files in both
cases.  I'll start my system doing a build, but I expect it'll take a few days.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-03-02 18:24           ` Richard Henderson
@ 2015-03-03 14:14             ` Uros Bizjak
  2015-03-03 16:31               ` Uros Bizjak
  0 siblings, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2015-03-03 14:14 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches, Michael Cree

On Mon, Mar 2, 2015 at 7:23 PM, Richard Henderson <rth@redhat.com> wrote:

>> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
>> and alphaev68-linux-gnu, the bootstrap still fails when configured
>> --with-build-config=bootstrap-lto:
>>
>> libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
>> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
>> relocation truncated to fit: GPREL16 against symbol `dump_file'
>> defined in .sbss section in libbackend.a(dumpfile.o)
>
> Interesting.  And using bootstrap-lto works with --no-relax?  I don't believe
> I've ever tried it...

Yes, I can re-confirm, that Rev: 221041 can bootstrap with
-Wl,--no-relax patch on alphaev68-linux-gnu, when configured with
"--with-build-config=bootstrap-lto --disable-werror
--enable-languages=c,c++,fortran" with binutils 2.25. I will post
testresults when bootstrap+regression test finish.

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-03-03 14:14             ` Uros Bizjak
@ 2015-03-03 16:31               ` Uros Bizjak
  0 siblings, 0 replies; 15+ messages in thread
From: Uros Bizjak @ 2015-03-03 16:31 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches, Michael Cree

On Tue, Mar 3, 2015 at 3:14 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Mar 2, 2015 at 7:23 PM, Richard Henderson <rth@redhat.com> wrote:
>
>>> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
>>> and alphaev68-linux-gnu, the bootstrap still fails when configured
>>> --with-build-config=bootstrap-lto:
>>>
>>> libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
>>> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
>>> relocation truncated to fit: GPREL16 against symbol `dump_file'
>>> defined in .sbss section in libbackend.a(dumpfile.o)
>>
>> Interesting.  And using bootstrap-lto works with --no-relax?  I don't believe
>> I've ever tried it...
>
> Yes, I can re-confirm, that Rev: 221041 can bootstrap with
> -Wl,--no-relax patch on alphaev68-linux-gnu, when configured with
> "--with-build-config=bootstrap-lto --disable-werror
> --enable-languages=c,c++,fortran" with binutils 2.25. I will post
> testresults when bootstrap+regression test finish.

Results are here [1].

[1] https://gcc.gnu.org/ml/gcc-testresults/2015-03/msg00346.html

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-02-27 13:35         ` Uros Bizjak
  2015-03-02 18:24           ` Richard Henderson
@ 2015-03-04 13:56           ` Uros Bizjak
  2015-03-04 14:30             ` Uros Bizjak
  1 sibling, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2015-03-04 13:56 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Fri, Feb 27, 2015 at 2:11 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, Feb 25, 2015 at 8:18 PM, Richard Henderson <rth@redhat.com> wrote:
>> On 02/25/2015 09:02 AM, Uros Bizjak wrote:
>>> The patch was tested on alpha-linux-gnu and alphaev68-linux-gnu for
>>> all default languages plus obj-c++ and go.
>>>
>>> OK for mainline?
>>
>> Ok.  Thanks.
>
> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
> and alphaev68-linux-gnu, the bootstrap still fails when configured
> --with-build-config=bootstrap-lto:
>
> libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1d0):
> relocation truncated to fit: GPREL16 against symbol `dump_flags'
> defined in .sbss section in libbackend.a(dumpfile.o)
> libbackend.a(tree-data-ref.o): In function
> `compute_overlap_steps_for_affine_1_2':
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72a8):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72b4):
> relocation truncated to fit: GPREL16 against symbol `dump_flags'
> defined in .sbss section in libbackend.a(dumpfile.o)
> libbackend.a(tree-data-ref.o): In function `analyze_siv_subscript_cst_affine':
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a5c):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a74):
> relocation truncated to fit: GPREL16 against symbol `dump_flags'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bc0):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bd8):
> relocation truncated to fit: GPREL16 against symbol `dump_flags'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8db8):
> relocation truncated to fit: GPREL16 against symbol `dump_file'
> defined in .sbss section in libbackend.a(dumpfile.o)
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8dd0):
> relocation truncated to fit: GPREL16 against symbol `dump_flags'
> defined in .sbss section in libbackend.a(dumpfile.o)
> libbackend.a(tree-data-ref.o): In function
> `dr_analyze_innermost(data_reference*, loop*)':
> /space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:802:(.text+0xb54c):
> additional relocation overflows omitted from the output
> collect2: error: ld returned 1 exit status
> ../../gcc-svn/trunk/gcc/lto/Make-lang.in:71: recipe for target 'lto1' failed
> gmake[3]: *** [lto1] Error 1

I just noticed that this error is from LTO profiledbootstrap build,
with the failed command:

/space/uros/gcc-build-profiled/./prev-gcc/xg++
-B/space/uros/gcc-build-profiled/./prev-gcc/
-B/usr/local/alphaev68-unknown-linux-gnu/bin/ -nostdinc++
-B/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
 -I/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/include/alphaev68-unknown-linux-gnu
 -I/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/include
 -I/space/uros/gcc-svn/trunk/libstdc++-v3/libsupc++
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
  -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-generate -fno-lto
-DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o lto1
lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o
lto/lto-partition.o lto/lto-symtab.o libbackend.a main.o
tree-browser.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a  -lmpc -lmpfr -lgmp -rdynamic -ldl
-L../zlib -lz libcommon.a ../libcpp/libcpp.a
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a

The LTO bootstrap works OK also without -Wl,--no-relax.

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-03-04 13:56           ` Uros Bizjak
@ 2015-03-04 14:30             ` Uros Bizjak
  2015-03-27 17:11               ` Uros Bizjak
  0 siblings, 1 reply; 15+ messages in thread
From: Uros Bizjak @ 2015-03-04 14:30 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Wed, Mar 4, 2015 at 2:56 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

>> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
>> and alphaev68-linux-gnu, the bootstrap still fails when configured
>> --with-build-config=bootstrap-lto:

[...]

>> ../../gcc-svn/trunk/gcc/lto/Make-lang.in:71: recipe for target 'lto1' failed
>> gmake[3]: *** [lto1] Error 1
>
> I just noticed that this error is from LTO profiledbootstrap build,
> with the failed command:

Digging even deeper into the command stream:

ld --eh-frame-hdr -m elf64alpha -O2 -export-dynamic -dynamic-linker
/lib/ld-linux.so.2 -o lto1 /usr/lib/crt1.o /usr/lib/crti.o
/space/uros/gcc-build-profiled/./prev-gcc/crtbegin.o
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-L../zlib -L/space/uros/gcc-build-profiled/./prev-gcc
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/space/uros/gcc-build-profiled/prev-alphaev68-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o
lto/lto-partition.o lto/lto-symtab.o libbackend.a main.o
tree-browser.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a -lmpc -lmpfr -lgmp -ldl -lz libcommon.a
../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -Bstatic
-lstdc++ -Bdynamic -lm -lgcov -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/space/uros/gcc-build-profiled/./prev-gcc/crtend.o /usr/lib/crtn.o

libbackend.a(tree-data-ref.o): In function `non_affine_dependence_relation':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1b8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1661:(.text+0x1d0):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function
`compute_overlap_steps_for_affine_1_2':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72a8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2265:(.text+0x72b4):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function `analyze_siv_subscript_cst_affine':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a5c):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1953:(.text+0x8a74):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bc0):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:1968:(.text+0x8bd8):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8db8):
relocation truncated to fit: GPREL16 against symbol `dump_file'
defined in .sbss section in libbackend.a(dumpfile.o)
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:2049:(.text+0x8dd0):
relocation truncated to fit: GPREL16 against symbol `dump_flags'
defined in .sbss section in libbackend.a(dumpfile.o)
libbackend.a(tree-data-ref.o): In function
`dr_analyze_innermost(data_reference*, loop*)':
/space/uros/gcc-build-profiled/gcc/../../gcc-svn/trunk/gcc/tree-data-ref.c:802:(.text+0xb54c):
additional relocation overflows omitted from the output

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..."
  2015-03-04 14:30             ` Uros Bizjak
@ 2015-03-27 17:11               ` Uros Bizjak
  0 siblings, 0 replies; 15+ messages in thread
From: Uros Bizjak @ 2015-03-27 17:11 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Wed, Mar 4, 2015 at 3:30 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, Mar 4, 2015 at 2:56 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>>> Unfortunately, while "normal" bootstrap works OK with alpha-linux-gnu
>>> and alphaev68-linux-gnu, the bootstrap still fails when configured
>>> --with-build-config=bootstrap-lto:
>
> [...]
>
>>> ../../gcc-svn/trunk/gcc/lto/Make-lang.in:71: recipe for target 'lto1' failed
>>> gmake[3]: *** [lto1] Error 1
>>
>> I just noticed that this error is from LTO profiledbootstrap build,
>> with the failed command:

The removal of the GPREL16 failure workaround has been reverted.

Uros.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-03-27 17:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-02  7:21 [PATCH, alpha]: Fix PR/47230 [4.6/4.7 Regression] gcc fails to bootstrap on alpha in stage2 with "relocation truncated to fit: GPREL16 against ..." Uros Bizjak
2014-07-26 16:12 ` Uros Bizjak
2014-07-28 17:02   ` Richard Henderson
2014-07-29 16:23     ` Uros Bizjak
2014-07-29 16:56       ` Richard Henderson
2014-07-29 19:53         ` Uros Bizjak
2015-02-25 19:18     ` Uros Bizjak
2015-02-25 19:35       ` Richard Henderson
2015-02-27 13:35         ` Uros Bizjak
2015-03-02 18:24           ` Richard Henderson
2015-03-03 14:14             ` Uros Bizjak
2015-03-03 16:31               ` Uros Bizjak
2015-03-04 13:56           ` Uros Bizjak
2015-03-04 14:30             ` Uros Bizjak
2015-03-27 17:11               ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).