Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1225156 - on AArch64 systemd 220 fails to build with gold linker
Summary: on AArch64 systemd 220 fails to build with gold linker
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: aarch64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARM64, F-ExcludeArch-aarch64
TreeView+ depends on / blocked
 
Reported: 2015-05-26 17:48 UTC by Marcin Juszkiewicz
Modified: 2015-06-21 21:59 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-21 21:59:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
spec fix for aarch64 (1.56 KB, patch)
2015-05-27 14:26 UTC, Marcin Juszkiewicz
no flags Details | Diff

Description Marcin Juszkiewicz 2015-05-26 17:48:54 UTC
Description of problem:

Binutils 2.25-8 enabled gold linker support for aarch64. Systemd uses gold and fails to build.

Version-Release number of selected component (if applicable):

2.25-8

How reproducible:

always

Steps to Reproduce:
1. do a build of systemd 220 with binutils 2.25-8

Actual results:

libtool: link: cc -o /builddir/build/BUILD/systemd-220/build3/tmp-introspectuuhzpQ/.libs/GUdev-1.0 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -Wl,-z -Wl,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld /builddir/build/BUILD/systemd-220/build3/tmp-introspectuuhzpQ/GUdev-1.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic  -L. ./.libs/libgudev-1.0.so /builddir/build/BUILD/systemd-220/build3/.libs/libudev.so -lrt -lcap -lm -ldw -ldl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -pthread
/builddir/build/BUILD/systemd-220/build3/tmp-introspectuuhzpQ/.libs/lt-GUdev-1.0: error while loading shared libraries: libgudev-1.0.so.0: ELF load command alignment not page-aligned

Expected results:

package builds

Additional info:

Successful builds with binutils 2.25-7

Comment 1 Marcin Juszkiewicz 2015-05-27 14:26:15 UTC
Created attachment 1030584 [details]
spec fix for aarch64

Systemd builds with this patch applied.

http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=3009857 is test build

Comment 2 Peter Robinson 2015-05-28 13:03:15 UTC
Moving back to binutils. The patch to the systemd spec is a work around not a fix to the actual problem

Comment 3 Nick Clifton 2015-06-01 14:30:12 UTC
Hi Marcin,

  Is this problem reproducible ?

  I ask because I find it very strange that the problem was introduced by the 2.25-8 revision of the binutils package.  The only change from 2.25-7 to 2.25-8 was to add a "Requires: coreutils" to the binutils.spec file.  That's it.  This change should have had no effect at all on any of the binutils builds, including the aarch64 build.

Cheers
  Nick

Comment 4 Peter Robinson 2015-06-01 14:54:10 UTC
>   Is this problem reproducible ?

Yes, completely

>   I ask because I find it very strange that the problem was introduced by
> the 2.25-8 revision of the binutils package.  The only change from 2.25-7 to
> 2.25-8 was to add a "Requires: coreutils" to the binutils.spec file.  That's
> it.  This change should have had no effect at all on any of the binutils
> builds, including the aarch64 build.

No, it's not that but the Release field actually doesn't align with the changelog NVR field numberings.

It's was the introduction of the gold linker that caused the problems.

Comment 5 Nick Clifton 2015-06-02 14:55:13 UTC
Hi Peter, Hi Marcin,

  Can one of you guys point me at a build environment where I can reproduce this problem ?  I have been trying to build systemd-220 on the  mustang-02.farm.hsv.redhat.com board, but to no avail.  It has a dependencies upon:
 
        firewalld-filesystem is needed by systemd-220-4.fc23.aarch64
        libseccomp-devel is needed by systemd-220-4.fc23.aarch64

which cannot be resolved. :-(

Cheers
  Nick

Comment 6 Marcin Juszkiewicz 2015-06-02 15:48:45 UTC
Nick: login to mustang and then "mock --uniqueext hrw -r fedora-rawhide-aarch64 shell" should drop you into chroot with all build dependencies installed.

In /builddir/ you have Fedora sources of binutils and systemd already checked out and all build dependencies are installed.

dnf is available inside of this chroot.

Comment 7 Peter Robinson 2015-06-08 12:00:15 UTC
>   Can one of you guys point me at a build environment where I can reproduce
> this problem ?  I have been trying to build systemd-220 on the 
> mustang-02.farm.hsv.redhat.com board, but to no avail.  It has a
> dependencies upon:

A fully updated rawhide should be fine now. we're pretty up to date for builds.

Comment 8 Nick Clifton 2015-06-10 12:38:33 UTC
Status update:

  I have not (yet) been able to reproduce the bug reported in this BZ, but I have been able to produce a similar problem:

 22698 Segmentation fault (core dumped) ( /bin/sh ../../libtool --mode=execute ./gudev-scan )

This happens during the build2 stage of the systemd build.  It turns out that gudev-scan is just a script that launches the lt-gudev-san executable in the .libs subdirectory.  This is the program that seg-faults.  Examining it with file shows:

  % file lt-gudev-scan
  lt-gudev-scan: ELF 64-bit LSB executable, ARM aarch64, version 1
  (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=6880f357fcda86e711e9e4778c4a3a5600ff6a86, not stripped

But, using ldd shows:

  % ldd lt-gudev-scan
    not a dynamic executable

So I think that this is the same problem that we have with BZ 1215546, ie the aarch64 gold linker produced binaries that are incompatible with Fedora, but which do work with other Linux variants.

  https://bugzilla.redhat.com/show_bug.cgi?id=1215546

The problem I have with that BZ, and now this one, is that I have no idea *why* the loader is rejecting these binaries.  If I knew that I could probably fix gold.  But I do not have any familiarity with the loader and I do not know how to force it to tell me what is wrong.

So maybe there are two gold bugs here, or maybe it is just one bug, manifesting itself in two different ways.

Anyway that is where I am at the moment.  Any help or ideas would be much appreciated.

Cheers
  Nick

PS.  I have confirmed that I can build the systemd rpm with the bfd linker installed as the default linker.

Comment 9 Zbigniew Jędrzejewski-Szmek 2015-06-10 12:51:31 UTC
We're in the process of removing gudev from systemd, so the problem might partially solve itself, it is only the gudev part which is causing problems. http://koji.fedoraproject.org/koji/buildinfo?buildID=644608 is the first build of libgudev as a separate package.

Comment 10 Marcin Juszkiewicz 2015-06-10 13:01:29 UTC
libgudev builds fine locally:

Wrote: /builddir/build/RPMS/libgudev-230-1.fc23.aarch64.rpm
Wrote: /builddir/build/RPMS/libgudev-devel-230-1.fc23.aarch64.rpm
Wrote: /builddir/build/RPMS/libgudev-debuginfo-230-1.fc23.aarch64.rpm

Comment 11 Peter Robinson 2015-06-10 14:11:20 UTC
> So I think that this is the same problem that we have with BZ 1215546, ie
> the aarch64 gold linker produced binaries that are incompatible with Fedora,
> but which do work with other Linux variants.

I think the main way that Fedora varies from other distros on aarch64 is the use of 64K page sizes rather than 4K. This caused us issues when running ARMv7 virt on aarch64 and needed a fix in binutils. Not sure if this might be related?

Comment 12 Nick Clifton 2015-06-10 19:41:20 UTC
Hi Peter,

  You are a genius sir.  The lack of a 64K page size does indeed seem to be the problem.  A small patch to the binutils rpm, (plus installing the newly built gold linker once the rpm has been created), fixes the building of systemd.  At least in the mock build environment on mustang-2.

Marcin, Peter - please try binutils-2.25-10.fc23 or binutils-2.25-8.fc22 and let me know if gold really is working now.

Cheers
  Nick

Comment 13 Peter Robinson 2015-06-10 20:25:37 UTC
Awesome! Building on aarch64 now, will try a scratch of systemd once done

http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=3031585

Comment 14 Jens Petersen 2015-06-11 07:16:09 UTC
(In reply to Nick Clifton from comment #12)
>   You are a genius sir.  The lack of a 64K page size does indeed seem to be
> the problem.  A small patch to the binutils rpm, (plus installing the newly
> built gold linker once the rpm has been created), fixes the building of
> systemd.  At least in the mock build environment on mustang-2.

Nice, I think Jakub also pointed to the page size in bug 1215546,
which I will try to test now.


Note You need to log in before you can comment on or make changes to this bug.