Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 512484 - app-emulation/qemu: building w/ccache sometimes fails: make[1]: *** No rule to make target '../qemu-log.c', needed by '../qemu-log.o'. Stop.
Summary: app-emulation/qemu: building w/ccache sometimes fails: make[1]: *** No rule t...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo QEMU Project
Depends on:
Reported: 2014-06-05 06:57 UTC by Marcin Kowalski
Modified: 2017-04-25 14:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

build messages (1402412976-install-app-emulation_qemu-2.0.0-r1:0::gentoo.out,216.60 KB, text/plain)
2014-06-10 15:19 UTC, Marcin Kowalski
package manager info [using paludis] (info.txt,24.18 KB, text/plain)
2014-06-10 15:19 UTC, Marcin Kowalski
qemu build options (qemu-options.txt,9.27 KB, text/plain)
2014-06-10 15:20 UTC, Marcin Kowalski
USE flag configuration (use.conf,1.57 KB, text/plain)
2014-06-10 15:23 UTC, Marcin Kowalski
build.log (app-emulation:qemu-2.0.0-r1:20140706-001513.log.gz,21.81 KB, application/gzip)
2014-07-06 00:31 UTC, Patrick Orth
build.log.gz (app-emulation:qemu-2.0.0-r1:20140713-061306.log.gz,67.95 KB, application/gzip)
2014-07-13 06:27 UTC, Patrick Orth
Details (,673 bytes, patch)
2015-08-09 06:42 UTC,
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Kowalski 2014-06-05 06:57:31 UTC
When building qemu-2.0.0-r1 the build fails in the following way : 

    x86_64-pc-linux-gnu-gcc -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/tcg -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/tcg/i386 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-headers -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/user-build/linux-headers -I. -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/include -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386 -Itarget-i386 -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all   -I/usr/include/libpng16     -I../linux-headers -I.. -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386 -DNEED_CPU_H -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/include -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-user/i386 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-user -MMD -MP -MT target-i386/kvm-stub.o -MF target-i386/kvm-stub.d -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -mtune=native -O2 -pipe --param ggc-min-expand=10  -c -o target-i386/kvm-stub.o /mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386/kvm-stub.c
    x86_64-pc-linux-gnu-gcc -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/tcg -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/tcg/i386 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-headers -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/user-build/linux-headers -I. -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/include -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386 -Itarget-i386 -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all   -I/usr/include/libpng16     -I../linux-headers -I.. -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386 -DNEED_CPU_H -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/include -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-user/i386 -I/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/linux-user -MMD -MP -MT target-i386/ioport-user.o -MF target-i386/ioport-user.d -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -mtune=native -O2 -pipe --param ggc-min-expand=10  -c -o target-i386/ioport-user.o /mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/target-i386/ioport-user.c
      * In program cave perform install --hooks --managed-output --output-exclusivity with-others =app-emulation/qemu-2.0.0-r1:0::gentoo --destination installed --x-of-y 1 of 1:
      * When installing 'app-emulation/qemu-2.0.0-r1:0::gentoo':
      * When running an ebuild command on 'app-emulation/qemu-2.0.0-r1:0::gentoo':
      * Install failed for 'app-emulation/qemu-2.0.0-r1:0::gentoo' (paludis::ActionFailedError)
    make[1]: Leaving directory '/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/user-build/i386-linux-user'
    Makefile:167: recipe for target 'subdir-i386-linux-user' failed
    make[1]: *** No rule to make target '../qemu-log.c', needed by '../qemu-log.o'.  Stop.
    make: *** [subdir-i386-linux-user] Error 2
    !!! ERROR in app-emulation/qemu-2.0.0-r1::gentoo:
    !!! In /usr/libexec/paludis/utils/emake at line 30
    !!! emake returned error 2

The solution is to symlink 
/mnt/storage/tmp/app-emulation-qemu-2.0.0-r1/work/qemu-2.0.0/user-build/../qemu-log.c ->

The error message repeats for a lot of files for user target, and for softmmu target. Symlinking them in similar manner causes the build to progress further and further (when keeping the build directory unchanged). It happens for both x86-64 targets and i386 targets. I haven't tested building any other qemu targets so far.

Installation is gentoo ~amd64, I'll provide more info as needed.

Reproducible: Always

Steps to Reproduce:
1. Try to build qemu
2. Observe the build error

Actual Results:  
Build process fails

Expected Results:  
Build process completes.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-06-05 11:23:56 UTC
1) Please attach the entire build log to this bug report.
2) Please post your `emerge --info' output in a comment.
Comment 2 Marcin Kowalski 2014-06-10 15:19:12 UTC
Created attachment 378636 [details]
build messages

submitting build log
Comment 3 Marcin Kowalski 2014-06-10 15:19:38 UTC
Created attachment 378638 [details]
package manager info [using paludis]

submitting package manager info
Comment 4 Marcin Kowalski 2014-06-10 15:20:01 UTC
Created attachment 378640 [details]
qemu build options

attaching USE flag configuration for qemu
Comment 5 Marcin Kowalski 2014-06-10 15:20:42 UTC
reopening, i'll also post my USE configuration in a minute.
Comment 6 Marcin Kowalski 2014-06-10 15:23:18 UTC
Created attachment 378642 [details]
USE flag configuration

attaching my USE flags setup. 

I've completely reinstalled gentoo from scratch and reproduced this build problem.

The qemu-log.c error happens on first qemu-user target that's being built. Building i386 and x86_64 fails on i386 target, building only x86_64 target fails on the same file in x86_64 target.
Comment 7 SpanKY gentoo-dev 2014-06-20 06:25:53 UTC
can't reproduce over here, and apparently no one else is seeing it either ...
Comment 8 Patrick Orth 2014-07-06 00:31:31 UTC
Created attachment 380268 [details]

Same Problem here
Comment 9 Patrick Orth 2014-07-06 00:59:34 UTC
Portage 2.2.6-r1-multilib (default/linux/amd64/13.0, gcc-4.9.0, glibc-2.19-r1, 3.15.3-gentoo x86_64)
System uname: Linux-3.15.3-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E3-1225_v3_@_3.20GHz-with-gentoo-2.2
KiB Mem:    31963048 total,  29068900 free
KiB Swap:   46399468 total,  46399468 free
Timestamp of tree: Fri, 04 Jul 2014 20:30:01 +0000
ld GNU ld (Gentoo p1.0)
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.6, 3.2.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/gcc:            4.9.0
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.15 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo multilib steam-overlay mv x-portage
CFLAGS="-O2 -mtune=generic -march=x86-64 -pipe   -flto=4      -fdiagnostics-color"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mtune=generic -march=x86-64 -pipe   -flto=4      -fdiagnostics-color"
EMERGE_DEFAULT_OPTS="--quiet-build --jobs"
FCFLAGS="-O2 -mtune=generic -march=x86-64 -pipe   -flto=4      -fdiagnostics-color"
FEATURES="assume-digests binpkg-logs ccache clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles force-multilib merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -mtune=generic -march=x86-64 -pipe   -flto=4      -fdiagnostics-color"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--enable-new-dtags -Wl,--hash-style=gnu -Wl,-flto"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/var/lib/layman/multilib-portage /var/lib/layman/steam /var/lib/layman/mv /usr/local/portage"
USE="10bit X aac aacplus aacs acl alsa amd64 apng audit avx avx2 berkdb bluray btrfs bzip2 caps cli corefonts cracklib crypt cups custom-cflags custom-optimization cxx dbus device-mapper dmraid dri dri3 egl enca f2fs fat fftw fma fma3 fontconfig ftp gbm gdbm gif gles gles1 gles2 gme gmp gtk gudev hfs iconv icu ipv6 jfs jpeg jpeg2k lcms libass libkms lvm2create_initrd lzma mdadm mmx mmxext mng modules mp3 mpi ncurses nls nptl openal opengl openmp openrc openvg opus orc osmesa pam pcre pgo pnm policykit pulseaudio python3 qt4 quvi readline reiser4 reiserfs schroedinger sdl session speex sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 systemd tcpd tga theora threads tiff tools trayicon truetype udev udisks unicode upower vaapi vcd vdpau vpx webp wxwidgets x265 xa xfs xinerama xtpax xv xvmc yuv4mpeg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="gnutls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="keyboard mouse joystick evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US en_GB de" MULTILIB_ABI="amd64 x86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7 python3_3" PYTHON_TARGETS="python3_3 python3_2 python2_7" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.2 3.3"
Comment 10 Patrick Orth 2014-07-13 06:27:45 UTC
Created attachment 380666 [details]

Disabling ccache fixed the problem for me.
Comment 11 SpanKY gentoo-dev 2014-07-29 09:38:44 UTC
if you clear your ccache cache and rebuild, does it work ?
Comment 12 Patrick Orth 2014-07-29 18:34:59 UTC
Enabled ccache again and tried building with a fresh ccache dir but it didn't work. The log looks similar.
Comment 13 Marcin Kowalski 2014-08-05 16:34:07 UTC
Hitting the same problem on qemu-2.1.0
Comment 14 Marcin Kowalski 2014-08-05 16:38:45 UTC
It also builds correctly with ccache disabled.
Comment 15 Matthias Maier gentoo-dev 2014-12-14 23:25:51 UTC
We now have versions 2.1.2-r2 and 2.2.0 to test.
Comment 16 Patrick Orth 2015-01-04 13:38:28 UTC
Tested 2.1.2-r2 and 2.2.0. They still have the same problem.
Comment 17 2015-08-09 06:39:29 UTC
I have encountered this but only with CCACHE_BASEDIR="${S}" and the reason is ccache will then convert absolute paths to relative paths but qemu actually has two nested build directories, so the relative paths are not valid in both.

So for example build/blockdev.d will contain the following when BASEDIR is in effect:

> blockdev.o: ../blockdev.c ../include/sysemu/block-backend.h \

And the target build under build/x86_64-softmmu or similar will depend on ../blockdev.o which in turn will get make to source ../blockdev.d to check its dependencies. Since make always considers paths relative to the current working directory rather than the makefile the path appeared in the relative path to ../blockdev.c is useless. A possible workaround is to add the top level build directory to vpath so make be able to resolve ../blockdev.c
Comment 18 2015-08-09 06:42:03 UTC
Created attachment 408590 [details, diff]

Add build directory to vpath, tested against latest git v2.4.0-rc4
Comment 19 Doug Goldstein (RETIRED) gentoo-dev 2015-08-09 18:31:39 UTC
(In reply to from comment #18)
> Created attachment 408590 [details, diff] [details, diff]
> Add build directory to vpath, tested against latest git v2.4.0-rc4

Please submit all patches upstream. Our goal is to not have a patched qemu.
Comment 20 2015-08-09 18:34:04 UTC
(In reply to Doug Goldstein from comment #19)
> (In reply to from comment #18)
> > Created attachment 408590 [details, diff] [details, diff] [details, diff]
> >
> > 
> > Add build directory to vpath, tested against latest git v2.4.0-rc4
> Please submit all patches upstream. Our goal is to not have a patched qemu.

Already did, just attached it here for reference:
Comment 21 2015-09-26 22:25:25 UTC
FYI, this patch has landed upstream:;a=commit;h=12a1ddc160cb6a73e8a6c319f3962a20da2cd22f
Comment 22 Matthias Maier gentoo-dev 2017-04-25 14:20:41 UTC
Patch present in all versions currently in tree. Closing.

Please reopen if problem persists.