alpha: Do not build with -fpic

Message ID 87zhcykatj.fsf@oldenburg2.str.redhat.com
State Committed
Headers

Commit Message

Florian Weimer March 2, 2020, 3:58 p.m. UTC
  The combination of GCC 10 and binutils 2.35 (both unreleased) is no
longer able to link the dynamic linker, due to a GP16 relocation
overflow error:

glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc': glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section in glibc/alpha-linux-gnu/elf/librtld.os
glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc': glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section in glibc/alpha-linux-gnu/elf/librtld.os

This is arguably a linker bug; the object files and their section size
requirements look reasonable enough.

Using -fPIC (the default) works around this issue.

-----
 sysdeps/alpha/Makefile | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Jeff Law March 2, 2020, 4:19 p.m. UTC | #1
On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
> longer able to link the dynamic linker, due to a GP16 relocation
> overflow error:
> 
> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
> in glibc/alpha-linux-gnu/elf/librtld.os
> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
> in glibc/alpha-linux-gnu/elf/librtld.os
> 
> This is arguably a linker bug; the object files and their section size
> requirements look reasonable enough.
> 
> Using -fPIC (the default) works around this issue.
Thanks.  I was literally just about to start chasing this down.  Everything was
fine last build (a week ago) and blew up in last night's test:

http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/

Jeff
  
Florian Weimer March 2, 2020, 4:22 p.m. UTC | #2
* Jeff Law:

> On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
>> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
>> longer able to link the dynamic linker, due to a GP16 relocation
>> overflow error:
>> 
>> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
>> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
>> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
>> in glibc/alpha-linux-gnu/elf/librtld.os
>> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
>> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
>> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
>> in glibc/alpha-linux-gnu/elf/librtld.os
>> 
>> This is arguably a linker bug; the object files and their section size
>> requirements look reasonable enough.
>> 
>> Using -fPIC (the default) works around this issue.
> Thanks.  I was literally just about to start chasing this down.  Everything was
> fine last build (a week ago) and blew up in last night's test:
>
> http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/

Credits for spotting this should go to Joseph:

  <https://www.sourceware.org/ml/libc-alpha/2020-02/msg01023.html>

Now we need an alpha maintainer to review the workaround.

Florian
  
Adhemerval Zanella March 2, 2020, 4:31 p.m. UTC | #3
On 02/03/2020 13:22, Florian Weimer wrote:
> * Jeff Law:
> 
>> On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
>>> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
>>> longer able to link the dynamic linker, due to a GP16 relocation
>>> overflow error:
>>>
>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
>>> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
>>> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
>>> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
>>> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>
>>> This is arguably a linker bug; the object files and their section size
>>> requirements look reasonable enough.
>>>
>>> Using -fPIC (the default) works around this issue.
>> Thanks.  I was literally just about to start chasing this down.  Everything was
>> fine last build (a week ago) and blew up in last night's test:
>>
>> http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/
> 
> Credits for spotting this should go to Joseph:
> 
>   <https://www.sourceware.org/ml/libc-alpha/2020-02/msg01023.html>
> 
> Now we need an alpha maintainer to review the workaround.

I fired up a build/check on a alpha machine, I will post the result
once it is done.
  
Adhemerval Zanella March 3, 2020, 11:21 a.m. UTC | #4
On 02/03/2020 13:31, Adhemerval Zanella wrote:
> 
> 
> On 02/03/2020 13:22, Florian Weimer wrote:
>> * Jeff Law:
>>
>>> On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
>>>> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
>>>> longer able to link the dynamic linker, due to a GP16 relocation
>>>> overflow error:
>>>>
>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
>>>> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
>>>> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
>>>> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
>>>> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>>
>>>> This is arguably a linker bug; the object files and their section size
>>>> requirements look reasonable enough.
>>>>
>>>> Using -fPIC (the default) works around this issue.
>>> Thanks.  I was literally just about to start chasing this down.  Everything was
>>> fine last build (a week ago) and blew up in last night's test:
>>>
>>> http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/
>>
>> Credits for spotting this should go to Joseph:
>>
>>   <https://www.sourceware.org/ml/libc-alpha/2020-02/msg01023.html>
>>
>> Now we need an alpha maintainer to review the workaround.
> 
> I fired up a build/check on a alpha machine, I will post the result
> once it is done.
> 

The results are essentially the same as the one I got for 2.31 release [1],
so no regression. I used the same toolchain on same kernel (Linux 5.3.6-titan-p1+,
gcc 8.3.0, binutils 2.31.1).

FAIL: crypt/badsalttest   
FAIL: elf/tst-prelink-cmp
XPASS: elf/tst-protected1a
XPASS: elf/tst-protected1b
UNSUPPORTED: iconv/tst-gconv-init-failure
UNSUPPORTED: io/test-lfs
UNSUPPORTED: io/tst-fallocate
UNSUPPORTED: io/tst-fallocate64
FAIL: io/tst-fts-lfs
FAIL: math/test-double-fma
FAIL: math/test-double-llrint
FAIL: math/test-double-llround
FAIL: math/test-double-lrint
FAIL: math/test-double-lround
FAIL: math/test-double-remainder
FAIL: math/test-double-scalbln
FAIL: math/test-double-scalbn
FAIL: math/test-fenv-return
FAIL: math/test-fexcept
FAIL: math/test-float-double-add
FAIL: math/test-float-double-sub
FAIL: math/test-float-fma
FAIL: math/test-float-ldouble-add
FAIL: math/test-float-ldouble-sub
FAIL: math/test-float-llrint
FAIL: math/test-float-llround
FAIL: math/test-float-lrint
FAIL: math/test-float-lround
FAIL: math/test-float-scalbln
FAIL: math/test-float-scalbn
FAIL: math/test-float128-llrint
FAIL: math/test-float128-llround
FAIL: math/test-float128-lrint
FAIL: math/test-float128-lround
FAIL: math/test-float32-float128-add
FAIL: math/test-float32-float128-sub
FAIL: math/test-float32-float32x-add
FAIL: math/test-float32-float32x-sub
FAIL: math/test-float32-float64-add
FAIL: math/test-float32-float64-sub
FAIL: math/test-float32-float64x-add
FAIL: math/test-float32-float64x-sub
FAIL: math/test-float32-fma
FAIL: math/test-float32-llrint
FAIL: math/test-float32-llround
FAIL: math/test-float32-lrint
FAIL: math/test-float32-lround
FAIL: math/test-float32-scalbln
FAIL: math/test-float32-scalbn
FAIL: math/test-float32x-fma
FAIL: math/test-float32x-llrint
FAIL: math/test-float32x-llround
FAIL: math/test-float32x-lrint
FAIL: math/test-float32x-lround
FAIL: math/test-float32x-remainder
FAIL: math/test-float32x-scalbln
FAIL: math/test-float32x-scalbn
FAIL: math/test-float64-fma
FAIL: math/test-float64-llrint
FAIL: math/test-float64-llround
FAIL: math/test-float64-lrint
FAIL: math/test-float64-lround
FAIL: math/test-float64-remainder
FAIL: math/test-float64-scalbln
FAIL: math/test-float64-scalbn
FAIL: math/test-float64x-llrint
FAIL: math/test-float32x-llround
FAIL: math/test-float32x-lrint
FAIL: math/test-float32x-lround
FAIL: math/test-float32x-remainder
FAIL: math/test-float32x-scalbln
FAIL: math/test-float32x-scalbn
FAIL: math/test-float64-fma
FAIL: math/test-float64-llrint
FAIL: math/test-float64-llround
FAIL: math/test-float64-lrint
FAIL: math/test-float64-lround
FAIL: math/test-float64-remainder
FAIL: math/test-float64-scalbln
FAIL: math/test-float64-scalbn
FAIL: math/test-float64x-llrint
FAIL: math/test-float64x-llround
FAIL: math/test-float64x-lrint
FAIL: math/test-float64x-lround
FAIL: math/test-ldouble-llrint
FAIL: math/test-ldouble-llround
FAIL: math/test-ldouble-lrint
FAIL: math/test-ldouble-lround
UNSUPPORTED: misc/tst-pkey
UNSUPPORTED: nptl/test-cond-printers
UNSUPPORTED: nptl/test-condattr-printers
UNSUPPORTED: nptl/test-mutex-printers
UNSUPPORTED: nptl/test-mutexattr-printers
UNSUPPORTED: nptl/test-rwlock-printers
UNSUPPORTED: nptl/test-rwlockattr-printers
UNSUPPORTED: timezone/tst-tzset
Summary of test results:  
     67 FAIL
   5004 PASS
     12 UNSUPPORTED
     17 XFAIL
      2 XPASS

[1] https://sourceware.org/glibc/wiki/Release/2.31#Alpha
  
Florian Weimer March 3, 2020, 12:28 p.m. UTC | #5
* Adhemerval Zanella:

> On 02/03/2020 13:31, Adhemerval Zanella wrote:
>> 
>> 
>> On 02/03/2020 13:22, Florian Weimer wrote:
>>> * Jeff Law:
>>>
>>>> On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
>>>>> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
>>>>> longer able to link the dynamic linker, due to a GP16 relocation
>>>>> overflow error:
>>>>>
>>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
>>>>> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
>>>>> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
>>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
>>>>> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
>>>>> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
>>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>>>
>>>>> This is arguably a linker bug; the object files and their section size
>>>>> requirements look reasonable enough.
>>>>>
>>>>> Using -fPIC (the default) works around this issue.
>>>> Thanks.  I was literally just about to start chasing this down.  Everything was
>>>> fine last build (a week ago) and blew up in last night's test:
>>>>
>>>> http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/
>>>
>>> Credits for spotting this should go to Joseph:
>>>
>>>   <https://www.sourceware.org/ml/libc-alpha/2020-02/msg01023.html>
>>>
>>> Now we need an alpha maintainer to review the workaround.
>> 
>> I fired up a build/check on a alpha machine, I will post the result
>> once it is done.
>> 
>
> The results are essentially the same as the one I got for 2.31 release [1],
> so no regression. I used the same toolchain on same kernel (Linux 5.3.6-titan-p1+,
> gcc 8.3.0, binutils 2.31.1).

Thanks for ding this.  Should I push the patch then?

Florian
  
Adhemerval Zanella March 3, 2020, 1 p.m. UTC | #6
On 03/03/2020 09:28, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 02/03/2020 13:31, Adhemerval Zanella wrote:
>>>
>>>
>>> On 02/03/2020 13:22, Florian Weimer wrote:
>>>> * Jeff Law:
>>>>
>>>>> On Mon, 2020-03-02 at 16:58 +0100, Florian Weimer wrote:
>>>>>> The combination of GCC 10 and binutils 2.35 (both unreleased) is no
>>>>>> longer able to link the dynamic linker, due to a GP16 relocation
>>>>>> overflow error:
>>>>>>
>>>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc':
>>>>>> glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to
>>>>>> fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section
>>>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>>>> glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc':
>>>>>> glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to
>>>>>> fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section
>>>>>> in glibc/alpha-linux-gnu/elf/librtld.os
>>>>>>
>>>>>> This is arguably a linker bug; the object files and their section size
>>>>>> requirements look reasonable enough.
>>>>>>
>>>>>> Using -fPIC (the default) works around this issue.
>>>>> Thanks.  I was literally just about to start chasing this down.  Everything was
>>>>> fine last build (a week ago) and blew up in last night's test:
>>>>>
>>>>> http://3.14.90.209:8080/job/alpha-linux-gnu/lastFailedBuild/
>>>>
>>>> Credits for spotting this should go to Joseph:
>>>>
>>>>   <https://www.sourceware.org/ml/libc-alpha/2020-02/msg01023.html>
>>>>
>>>> Now we need an alpha maintainer to review the workaround.
>>>
>>> I fired up a build/check on a alpha machine, I will post the result
>>> once it is done.
>>>
>>
>> The results are essentially the same as the one I got for 2.31 release [1],
>> so no regression. I used the same toolchain on same kernel (Linux 5.3.6-titan-p1+,
>> gcc 8.3.0, binutils 2.31.1).
> 
> Thanks for ding this.  Should I push the patch then?

I think it is the simplest solution, I tried built with -fpic -mlarge-text without
success.
  

Patch

diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
index da52c1d4d1..baf5d480e5 100644
--- a/sysdeps/alpha/Makefile
+++ b/sysdeps/alpha/Makefile
@@ -57,10 +57,6 @@  endif
 # "current" rounding mode, and it's easiest to set this with all of them.
 sysdep-CFLAGS += -mieee -mfp-rounding-mode=d
 
-# libc.so requires about 16k for the small data area, which is well
-# below the 64k maximum.
-pic-ccflag = -fpic
-
 #  Software floating-point emulation.
 
 ifeq ($(subdir),soft-fp)