Bug 4410 - systemd: do_compile failed in parallel builds with system's make 3.28
Summary: systemd: do_compile failed in parallel builds with system's make 3.28
Status: RESOLVED WONTFIX
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-04-24 11:04 UTC by Hongxu Jia
Modified: 2013-04-25 09:53 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hongxu Jia 2013-04-24 11:04:02 UTC
*env:
Build Configuration:
BB_VERSION        = "1.18.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "SUSE-LINUX-12.1"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "1.4"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "hongxu-0417-dylan:87eb70243749e0e2431f98770746fa42002f4441"

$make --version
GNU Make 3.82
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$vim conf/local.conf
...
PARALLEL_MAKE = "-j 8"
MACHINE ?= "qemux86-64"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
...

*problem
Create a new environment to build systemd, do_compile failed:
...
./x86_64-poky-linux-libtool --mode=execute x86_64-poky-linux-objcopy -O binary -j introspect.Target systemd org.freedesktop.systemd1.Target.xml.tmp && \
        x86_64-poky-linux-strings org.freedesktop.systemd1.Target.xml.tmp | gawk -f /buildarea2/hongxujia/build-20130417-systemd-exlusive-multilib/tmp/work/x86_64-poky-linux/systemd/1_199-r5/systemd-199/introspect.awk | \
        x86_64-poky-linux-cpp  --sysroot=/buildarea2/hongxujia/build-20130417-systemd-exlusive-multilib/tmp/sysroots/qemux86-64    -m64 -P -O2 -pipe -g -feliminate-unused-debug-types -I/buildarea2/hongxujia/build-20130417-systemd-exlusive-multilib/tmp/sysroots/qemux86-64/usr/include/dbus-1.0 -I/buildarea2/hongxujia/build-20130417-systemd-exlusive-multilib/tmp/sysroots/qemux86-64/usr/lib/dbus-1.0/include   -imacros dbus/dbus-protocol.h -o org.freedesktop.systemd1.Target.xml - && rm org.freedesktop.systemd1.Target.xml.tmp
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Manager.xml] Error 1
make[2]: *** Waiting for unfinished jobs....
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Job.xml] Error 1
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Unit.xml] Error 1
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Socket.xml] Error 1
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Target.xml] Error 1
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Service.xml] Error 1
x86_64-poky-linux-objcopy: 'systemd': No such file
make[2]: *** [org.freedesktop.systemd1.Timer.xml] Error 1
...

*analysis
1, The error is about parallel make race, see: 
http://savannah.gnu.org/bugs/?30653

2, The system's make 3.28 didn't add patch to fix this defect,
but Yocto's make 3.28 has fixed. See oe-core: 
meta/recipes-devtools/make/make-3.82/intermediate-target-bugfix.patch

*solution
Add `make-native' to systemd's `DEPENDS' to use Yocto's make rather
than system's to compile systemd.
Comment 1 Ross Burton 2013-04-25 09:53:10 UTC
Installing make-native during a build will lead to races over the make binary, causing strange and non-obvious build failures.  3.82 in certain distros is a known issue and we'll be adding to the release notes that if you have a broken make, run "bitbake make-native" *first*.

That said, 12.1 has the patches required to fix this (https://build.opensuse.org/package/show?package=make&project=openSUSE%3A12.1%3AUpdate, make-parallel-build.patch, added 5 weeks ago) so please update your distro and this will fix itself.

I'm also told that 12.1 will be EOL in 21 days from now, so you should consider upgrading to 12.3.