Bug 888255

Summary: PowerPC: FTBFS: systemd-196/src/core/manager.c:2092: undefined reference to `sd_notifyf'
Product: [Fedora] Fedora Reporter: Karsten Hopp <karsten>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 19CC: johannbg, lnykryn, metherid, msekleta, notting, plautrba, raj.khem, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-201-2.fc18.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-16 03:00:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karsten Hopp 2012-12-18 12:09:20 UTC
Description of problem:
systemd-196 fails to build on PPC (32bit):

  CCLD     systemd-journal-gatewayd
./.libs/libsystemd-core.a(libsystemd_core_la-manager.o): In function `manager_check_finished':
/builddir/build/BUILD/systemd-196/src/core/manager.c:2092: undefined reference to `sd_notifyf'
collect2: error: ld returned 1 exit status
make[2]: *** [test-unit-file] Error 1

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

How reproducible:
always

Steps to Reproduce:
1. ppc-koji build --scratch f19 systemd-196-3.fc19.src.rpm
2.
3.
  
Actual results:
all releases of systemd-196 fail to build with this error:

http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=825937

Expected results:


Additional info:
all releases of systemd-196 fail to build with this error

Comment 1 Lukáš Nykrýn 2012-12-18 16:29:06 UTC
I think that sufficiet fix would be:
diff --git a/Makefile.am b/Makefile.am
index 804cc04..acbb12b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1068,7 +1068,8 @@ libsystemd_core_la_SOURCES = \
        src/core/syscall-list.c \
        src/core/syscall-list.h \
        src/core/audit-fd.c \
-       src/core/audit-fd.h
+       src/core/audit-fd.h \
+       src/libsystemd-daemon/sd-daemon.c

 if HAVE_KMOD
 libsystemd_core_la_SOURCES += \

Comment 2 Karsten Hopp 2012-12-18 18:29:14 UTC
A scratch build with this patch succeeded, but I'm still puzzled why this fails on ppc32 only.

Comment 3 Lennart Poettering 2012-12-22 09:31:38 UTC
We pull in sd-daemon.c in anyway with libsystemd_daemon.la. So the patch should not be necessary. 

THis appears to be a problem with PPC only, maybe some toolchain issue?

Comment 4 Khem Raj 2013-01-23 02:34:43 UTC
I think ppc link is doing something right, its asking for resolving a symbol which it could not find in any library specified on cmdline but same thing on arm ld happily emits UND sd_notifyf and if you dump DT_NEEDED section then there is no asking for libsystemd-daemon.so so IMO non ppc architectures are doing it wrongly here.

on ppc

./.libs/libsystemd-core.a(libsystemd_core_la-manager.o): In function `manager_check_finished':
/b/kraj/angstrom/build/tmp-angstrom_next-uclibc/work/ppc603e-angstrom-linux-uclibc/systemd/196-r0/systemd-196/src/core/manager.c:2099: undefined reference to `sd_notifyf'
collect2: error: ld returned 1 exit status

DT_NEEDED on arm

$ readelf -d .libs/test-unit-file

Dynamic section at offset 0x11d94 contains 35 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libdbus-1.so.3]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libudev.so.1]
 0x00000001 (NEEDED)                     Shared library: [librt.so.0]
 0x00000001 (NEEDED)                     Shared library: [libpam.so.0]
 0x00000001 (NEEDED)                     Shared library: [libcap.so.2]
 0x00000001 (NEEDED)                     Shared library: [libssp.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
 0x00000001 (NEEDED)                     Shared library: [ld-uClibc.so.0]

we dont have libsystemd-daemon.so.X there.

and sd_notifyf is referred from libsystemd_core_la-manager.o

When I compare cmdline for for linking .libs/test-unit-file on ppc and arm in both cases I see that we are asking for ./.libs/libsystemd-core.a libdbus-1.so -lpthread .libs/libudev.so -lrt -lcap libkmod.so -ldl

no where we are asking for linking with libsystemd_daemon which provides this symbol so I think systemd's link cmdline is incomplete here. It just happens to link on non-ppc architectures but if sd_notifyf() would be called by 'test-unit-file' at runtime by  it wont be resolved.

I have posted a patch for this here

http://lists.freedesktop.org/archives/systemd-devel/2013-January/008318.html

after this patch now DT_NEEDED looks good

$ readelf -d .libs/test-unit-file

Dynamic section at offset 0xb0ed8 contains 32 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libdbus-1.so.3]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libudev.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpam.so.0]
 0x00000001 (NEEDED)                     Shared library: [libcap.so.2]
 0x00000001 (NEEDED)                     Shared library: [libsystemd-daemon.so.0]
 0x00000001 (NEEDED)                     Shared library: [librt.so.0]
 0x00000001 (NEEDED)                     Shared library: [libssp.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
 0x00000001 (NEEDED)                     Shared library: [ld-uClibc.so.0]


and link also succeeds

Comment 5 Lennart Poettering 2013-03-07 16:17:16 UTC
Fixed in git.

Comment 6 Fedora End Of Life 2013-04-03 20:21:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 7 Fedora Update System 2013-04-10 20:15:52 UTC
systemd-201-2.fc18.1 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-201-2.fc18.1

Comment 8 Fedora Update System 2013-04-11 23:29:00 UTC
Package systemd-201-2.fc18.2:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.2'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.2
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-04-16 00:03:38 UTC
Package systemd-201-2.fc18.4:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.4'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.4
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2013-04-18 02:41:12 UTC
Package systemd-201-2.fc18.5:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.5
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-05-07 13:43:05 UTC
systemd-201-2.fc18.6 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.6

Comment 12 Fedora Update System 2013-05-09 10:04:46 UTC
Package systemd-201-2.fc18.6:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.6
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2013-05-16 03:00:22 UTC
systemd-201-2.fc18.6 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.