Re: Bug#888478: systemd FTBFS on mipsel: /usr/bin/ld: BFD (GNU Binutils for Debian) 2.29.90.20180122 assertion fail ../../bfd/elflink.c:9757

James Cowgill <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
Control: forwarded -1 https://sourceware.org/bugzilla/show_bug.cgi?id=22751
Control: retitle -1 binutils: lto broken for libgcc libcalls

Hi,

On 26/01/18 15:38, Aurelien Jarno wrote:
> On 2018-01-26 15:19, James Cowgill wrote:
>> Hi,
>>
>> On 26/01/18 08:57, Aurelien Jarno wrote:
>>>> The build was performed on eller.d.o.
>>>>
>>>> If you reassign to binutils, please set affects.
>>>>
>>>> I put [email protected] into X-Debbugs-Cc. During cross builds I was able to
>>>> reproduce a very similar build failure for mips and armhf. A native
>>>> build on amd64 seems unaffected. Thus I have included [email protected] as
>>>> well.
>>>
>>> Note that the build also fails on i386 on the same files, but in a
>>> different way:
>>>
>>> | FAILED: test-ipv4ll
>>> | cc  -o test-ipv4ll 'test-ipv4ll@exe/src_libsystemd-network_test-ipv4ll.c.o' -flto -Wl,--no-undefined -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -pie -Wl,--gc-sections -g -O2 -fdebug-prefix-map=/tmp/systemd-236=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wl,--start-group src/shared/libsystemd-shared-236.so src/libsystemd-network/libsystemd-network.a -Wl,--end-group '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/tmp/systemd-236/build-deb/src/shared 
>>> | /usr/bin/ld: /tmp/ccFNIZSq.ltrans0.ltrans.o(.text+0x99f): unresolvable R_386_PLT32 relocation against symbol `__umoddi3'
>>> | /usr/bin/ld: final link failed: Nonrepresentable section on output
>>> | collect2: error: ld returned 1 exit status
>>>
>>> That might help debugging the issue as it is more understandable than
>>> a simple assert.
>>
>> Fairly minimal testcase which triggers both bugs:
>>
>> test.c:
>> volatile unsigned long long a = 42;
>> volatile unsigned long long b = 1;
>>
>> int main(void)
>> {
>>         return (int) (a / b);
>> }
>>
>> build with:
>> gcc -flto -O2 -c test.c
>> ar rcs libtest.a test.o
>> gcc -flto -Wl,--whole-archive libtest.a -Wl,--no-whole-archive
>>
>> On mipsel:
>> /usr/bin/ld: BFD (GNU Binutils for Debian) 2.29.90.20180122 assertion fail ../../bfd/elflink.c:9757
>> collect2: error: ld returned 1 exit status
>>
>> On i386:
>> /usr/bin/ld: /tmp/cc5ZOEfW.ltrans0.ltrans.o(.text.startup+0x3d): unresolvable R_386_PLT32 relocation against symbol `__udivdi3'
>> /usr/bin/ld: final link failed: Nonrepresentable section on output
>> collect2: error: ld returned 1 exit status
> 
> Thanks for the reduced testcase. It means it can also be easily
> reproduced on amd64 with the following command but slightly different
> code:
> 
> volatile  __int128 a = 42;
> volatile  __int128 b = 1;
> 
> int main(void)
> {
>         return (int) (a / b);
> }
> 
> /usr/bin/ld: /tmp/ccwdC3bA.ltrans0.ltrans.o(.text.startup+0x21): unresolvable R_X86_64_PLT32 relocation against symbol `__divti3'
> /usr/bin/ld: final link failed: Nonrepresentable section on output

Thanks for that.

I've submitted an upstream bug and bisected it for them. I've guessed a
bug title which is hopefully more accurate (since this is not mipsel
specific).

James
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE+Ixt5DaZ6POztUwQx/FnbeotAe8FAlprXrIACgkQx/Fnbeot
Ae/pZQ//RrvxnhSKqZH2LC5JfkqBCrVAuiBoDb7063ZPylIq24t3l/LaqKdhCrGW
luw8Beqdn1IWEIeVbSoW+B6wOMQ/Ujufxi+GlHXnQvJI0hRxTJiy8JEbDxDGJvZo
NT0Zaz/0FOE9/7XAElELwzDOtZruAJe6ju7ems86mVVR84fIPAG2L3futXJEyTn1
Gm/g731kat9CuF2XBHvBiD4D7R4nKn/Sx7eo5A9Kj/p1hfECxHQzscY+xeXmRgPT
jsPuSCBPAmXRMq9Lgg39gL7J1Iz176A2eN1A9IwmjdbRvqbYeQ5v7r9izp911LGE
KtcBa6xWF0hgXRfzELnRBib0/r5Q1Tu8s8ZnbFMT55Jq1tF5s3N+RyepKoLmXY4k
7a4w2UU25m6uSRNYBB28X5E3m1EH0SY6DL1vU804rCZYTLyHaS4FDyGAKzJlNXvt
kD/C5/5111nmljFR9zc9ByE9IRRXx6bI0UFnL/CcUqNy4HVYnqMNeLPm8l/BAPlG
mYOKos5uQCtJSCkSRJdcEsvLLKZxVMVIYid9YyLlnenBKvr1M0nQD6MPMYAhMK1C
rC1mYYqnEAxdHsAZwBlKQldwAuuwOUqxZ5tv5VRNk1wfs/fgquWH+nSXn1cSbXcZ
2oN0O6PkIq57pZF6MUN7+a+6TTXvJqGSbrgV0DNaWJReyCUxEoY=
=UGUn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.