Re: binutils: s390x: fails to link systemd binaries using LTO

2017-06-19 Thread Michael Biebl
On Tue, 30 May 2017 22:21:04 +0200 Michael Biebl  wrote:
> Package: binutils
> Version: 2.28-5
> Severity: normal
> User: debian-s390@lists.debian.org
> Usertags: s390x
> 
> Hi,
> 
> we run into a strange issue when trying to compile systemd git master
> using meson. The build/link failure is s390x specific so I've CCed the
> s390x porters mailing list. The problem is easily reproducible on the
> zelenka porterbox. with the following commands:
> 
> sessionid=$(schroot -b -c sid)
> dd-schroot-cmd -c $sessionid apt-get update
> dd-schroot-cmd -c $sessionid apt-get upgrade -y
> dd-schroot-cmd -c $sessionid apt-get build-dep systemd -y
> dd-schroot-cmd -c $sessionid apt-get install meson git -y
> schroot -r -c $sessionid
> git clone https://github.com/systemd/systemd
> cd systemd
> export LANG=C.UTF-8
> meson -Db_lto=true -Dlink-udev-shared=false build
> ninja -C build
> 
> This will lead to a failure to link the systemd-networkd,
> test-network-tables and test-network binaries. I've attached the
> relevant excerpt from the build log.
> 
> Since this issue seems to be arch specific, this appears to be a problem
> in the s390x toolchain and not systemd itself.
> 
> We would appreciate if the s390(x) porters could have a look.

Any feedback fro the s390 porters?


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: binutils: s390x: fails to link systemd binaries using LTO

2017-06-20 Thread Aurelien Jarno
On 2017-06-19 23:50, Michael Biebl wrote:
> On Tue, 30 May 2017 22:21:04 +0200 Michael Biebl  wrote:
> > Package: binutils
> > Version: 2.28-5
> > Severity: normal
> > User: debian-s390@lists.debian.org
> > Usertags: s390x
> > 
> > Hi,
> > 
> > we run into a strange issue when trying to compile systemd git master
> > using meson. The build/link failure is s390x specific so I've CCed the
> > s390x porters mailing list. The problem is easily reproducible on the
> > zelenka porterbox. with the following commands:
> > 
> > sessionid=$(schroot -b -c sid)
> > dd-schroot-cmd -c $sessionid apt-get update
> > dd-schroot-cmd -c $sessionid apt-get upgrade -y
> > dd-schroot-cmd -c $sessionid apt-get build-dep systemd -y
> > dd-schroot-cmd -c $sessionid apt-get install meson git -y
> > schroot -r -c $sessionid
> > git clone https://github.com/systemd/systemd
> > cd systemd
> > export LANG=C.UTF-8
> > meson -Db_lto=true -Dlink-udev-shared=false build
> > ninja -C build
> > 
> > This will lead to a failure to link the systemd-networkd,
> > test-network-tables and test-network binaries. I've attached the
> > relevant excerpt from the build log.
> > 
> > Since this issue seems to be arch specific, this appears to be a problem
> > in the s390x toolchain and not systemd itself.
> > 
> > We would appreciate if the s390(x) porters could have a look.

Could you please Cc the s390x porters next time? That would make us
notice the issue faster.

> Any feedback fro the s390 porters?

The problem is related to the fact that gold is not available on s390x.
It seems gold is less strict than ld in having to link with each used
library. The problem can be fully reproduced on amd64 by using ld instead
of gold:

--- a/meson.build
+++ b/meson.build
@@ -312,7 +312,7 @@ link_test_c = files('tools/meson-link-test.c')
 foreach arg : ['-Wl,-z,relro',
'-Wl,-z,now',
'-pie',
-   '-Wl,-fuse-ld=gold',
+   '-Wl,-fuse-ld=ld',
   ]
 
 have = run_command(check_compilation_sh,


Now to come back to the problem, the test is linked against
src/libsystemd/libsystemd.a which uses pthread_sigmask. It looks
therefore normal to add -lpthread to link it.

Regards,
Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net


signature.asc
Description: PGP signature


Re: binutils: s390x: fails to link systemd binaries using LTO

2017-06-20 Thread Michael Biebl
Hi Aurelien

Am 20.06.2017 um 23:56 schrieb Aurelien Jarno:
> Could you please Cc the s390x porters next time? That would make us
> notice the issue faster.

Hm, when filing the bug report I used X-Debbugs-CC and got this
confirmation:

As you requested using X-Debbugs-CC, your message was also forwarded to
  debian-s390@lists.debian.org

Did this not reach the correct mailing list?


> The problem is related to the fact that gold is not available on s390x.
> It seems gold is less strict than ld in having to link with each used
> library. The problem can be fully reproduced on amd64 by using ld instead
> of gold:
> 
> --- a/meson.build
> +++ b/meson.build
> @@ -312,7 +312,7 @@ link_test_c = files('tools/meson-link-test.c')
>  foreach arg : ['-Wl,-z,relro',
> '-Wl,-z,now',
> '-pie',
> -   '-Wl,-fuse-ld=gold',
> +   '-Wl,-fuse-ld=ld',
>]
>  
>  have = run_command(check_compilation_sh,
> 
> 
> Now to come back to the problem, the test is linked against
> src/libsystemd/libsystemd.a which uses pthread_sigmask. It looks
> therefore normal to add -lpthread to link it.

Thanks for having a look. Will forward this issue to systemd upstream
after verifying that adding -lpthread fixes the issue.

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: binutils: s390x: fails to link systemd binaries using LTO

2017-06-20 Thread Aurelien Jarno
On 2017-06-21 00:21, Michael Biebl wrote:
> Hi Aurelien
> 
> Am 20.06.2017 um 23:56 schrieb Aurelien Jarno:
> > Could you please Cc the s390x porters next time? That would make us
> > notice the issue faster.
> 
> Hm, when filing the bug report I used X-Debbugs-CC and got this
> confirmation:
> 
> As you requested using X-Debbugs-CC, your message was also forwarded to
>   debian-s390@lists.debian.org
> 
> Did this not reach the correct mailing list?

The mailing list is correct. That said, I don't see any track of the
original email in my mbox nor on the web archive. It might also be a
problem with the BTS.
 
> > The problem is related to the fact that gold is not available on s390x.
> > It seems gold is less strict than ld in having to link with each used
> > library. The problem can be fully reproduced on amd64 by using ld instead
> > of gold:
> > 
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -312,7 +312,7 @@ link_test_c = files('tools/meson-link-test.c')
> >  foreach arg : ['-Wl,-z,relro',
> > '-Wl,-z,now',
> > '-pie',
> > -   '-Wl,-fuse-ld=gold',
> > +   '-Wl,-fuse-ld=ld',
> >]
> >  
> >  have = run_command(check_compilation_sh,
> > 
> > 
> > Now to come back to the problem, the test is linked against
> > src/libsystemd/libsystemd.a which uses pthread_sigmask. It looks
> > therefore normal to add -lpthread to link it.
> 
> Thanks for having a look. Will forward this issue to systemd upstream
> after verifying that adding -lpthread fixes the issue.

Thanks.

Regards,
Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net


signature.asc
Description: PGP signature


Re: binutils: s390x: fails to link systemd binaries using LTO

2017-06-21 Thread Michael Biebl
Closing this bug report, needs to be fixed in src:systemd


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature