| Summary: | systemd: gold linker fails for ppc machine | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Randy MacLeod <randy.macleod> | ||||||
| Component: | devtools / tool chain | Assignee: | Randy MacLeod <randy.macleod> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, raj.khem, randy.macleod | ||||||
| Version: | 2.5 | ||||||||
| Target Milestone: | 2.4 M3 | ||||||||
| Hardware: | x86 | ||||||||
| OS: | ppc | ||||||||
| Whiteboard: | |||||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||||
| Attachments: |
|
||||||||
Tomorrow, I'll look for a fix in the binutils-gnu git repo. Threre are some fixes on master that look promising. Then I guess I should try to come up with a minimal reproducer and report the bug to the binutils devs. Created attachment 3836 [details]
0001-systemd-work-around-ppc-gold-linker-error.patch (with patch!)
I had forgotten the patch originally.
Assigning this back to you Randy since you already seem to have a handle on the fix ;) webkitgtk_2.16.1 also fails for qemuppc with a similar error. I haven't tried to work-around the bug. I've reported the gold defect upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=21678 Gcc devs have a proposed patch that I'll test soon. (In reply to comment #5) > Gcc devs have a proposed patch that I'll test soon. Err, wrong bug, ignore this. I'm getting caught up after vacation. Fixed by: commit 0d1273cdf8652bf1844f1f1fe4ba0eacd27ada65 Author: Randy MacLeod <Randy.MacLeod@windriver.com> Date: Tue Jun 27 21:35:06 2017 -0400 binutils: update SRCREV to fix powerpc gold link bug Update to the latest commit on the 2.28 branch to pick up: a3e00a8 [GOLD] Avoid duplicate PLT stub symbols on ppc32 along with several backported bug fixes for arm*, etc. This resolves the systemd link error for qemuppc with the error message: .../powerpc-oe-linux-ld.gold: error: invalid STB_LOCAL symbol in external symbols error: linker defined: multiple definition of '00000001.plt_call.memcpy+8000' command line: previous definition here described in: [YOCTO #11696] |
Created attachment 3835 [details] Work-arorund for gold linker bug to enable systemd to build. This is likely a binutils bug. A qemuppc specific work-around that uses fuse-ld=bfd rather than fuse-ld=gold is attached. If you enable systemd in conf/local.conf: VIRTUAL-RUNTIME_init_manager = "systemd" DISTRO_FEATURES_append = " systemd" DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit" KERNEL_FEATURES_append = " cfg/systemd.scc" and build for qemuppc: $ bitbake systemd it eventually fails to link like this: powerpc-oe-linux-libtool: link: powerpc-oe-linux-gcc -m32 -mhard-float -mcpu=7400 -mno-spe --sysroot=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp -glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot -pipe -Wall -Wextra -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -W error=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-resul t -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -O2 -p ipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0=/usr/src/debug/systemd/1_232-r0 -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/re cipe-sysroot-native= -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot= -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -Wl,-fuse-ld=gold -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-nee ded -o scsi_id src/udev/scsi_id/scsi_id.o src/udev/scsi_id/scsi_serial.o ./.libs/libshared.a -lresolv -lcap -lrt -lm -llzma -lacl -pthread powerpc-oe-linux-libtool: link: ( cd ".libs" && rm -f "libnss_myhostname.la" && ln -s "../libnss_myhostname.la" "libnss_myhostname.la" ) /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: error: invalid STB_LOCAL symbol in external symbols /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: error: linker defined: multiple definition of '00000001.plt_call.free+8000' /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: command line: previous definition here /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: error: invalid STB_LOCAL symbol in external symbols /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: error: linker defined: multiple definition of '00000001.plt_call.strspn+8000' /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-oe-linux-ld.gold: command line: previous definition here /buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/systemd/1_232-r0/recipe-sysroot-native/usr/bin/powerpc-oe-linux/powerpc-