Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533918 - sys-apps/linux-misc-apps-3.18 - make: *** No rule to make target '../../../../turbostat'. Stop.
Summary: sys-apps/linux-misc-apps-3.18 - make: *** No rule to make target '../../../.....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: UPSTREAM
: 536202 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-29 13:59 UTC by Thomas Deutschmann (RETIRED)
Modified: 2022-05-10 19:39 UTC (History)
10 users (show)

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


Attachments
turbostat build fix + usbip (linux-misc-apps-3.18.ebuild.patch,2.26 KB, patch)
2015-02-14 08:40 UTC, Jan Psota
Details | Diff
Patch against linux-misc-apps-3.18 with turbostat fix + usbip (linux-misc-apps-4.0.2.ebuild.diff,5.36 KB, patch)
2015-05-06 23:42 UTC, Thomas Deutschmann (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2014-12-29 13:59:55 UTC
Hi,

upgrading sys-apps/linux-misc-apps from v3.6-r2 to v3.18 failed:

 * Package:    sys-apps/linux-misc-apps-3.18
 * Repository: gentoo
 * Maintainer: robbat2@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux tcpd userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.18.1-gentoo/build
 * Found sources for kernel version:
 *     3.18.1-gentoo
>>> Unpacking source...
>>> Unpacking linux-3.18.tar.xz to /var/tmp/portage/sys-apps/linux-misc-apps-3.18/work
>>> Source unpacked in /var/tmp/portage/sys-apps/linux-misc-apps-3.18/work
>>> Preparing source in /var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18 ...
 * Building Documentation/accounting/getdelays.c => getdelays
make --jobs 6 -f /dev/null M=Documentation/accounting ARCH=x86 Documentation/accounting/getdelays 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  Documentation/accounting/getdelays.c   -o Documentation/accounting/getdelays
 * Building tools/cgroup/cgroup_event_listener.c => cgroup_event_listener
make --jobs 6 -f /dev/null M=tools/cgroup ARCH=x86 tools/cgroup/cgroup_event_listener 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  tools/cgroup/cgroup_event_listener.c   -o tools/cgroup/cgroup_event_listener
 * Building Documentation/laptops/dslm.c => dslm
make --jobs 6 -f /dev/null M=Documentation/laptops ARCH=x86 Documentation/laptops/dslm 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  Documentation/laptops/dslm.c   -o Documentation/laptops/dslm
 * Building Documentation/laptops/freefall.c => freefall
make --jobs 6 -f /dev/null M=Documentation/laptops ARCH=x86 Documentation/laptops/freefall 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  Documentation/laptops/freefall.c   -o Documentation/laptops/freefall
 * Building Documentation/networking/timestamping/timestamping.c => timestamping
make --jobs 6 -f /dev/null M=Documentation/networking/timestamping ARCH=x86 Documentation/networking/timestamping/timestamping 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  Documentation/networking/timestamping/timestamping.c   -o Documentation/networking/timestamping/timestamping
 * Building Documentation/watchdog/src/watchdog-simple.c => watchdog-simple
make --jobs 6 -f /dev/null M=Documentation/watchdog/src ARCH=x86 Documentation/watchdog/src/watchdog-simple 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  Documentation/watchdog/src/watchdog-simple.c   -o Documentation/watchdog/src/watchdog-simple
 * Building tools/lguest/lguest.c => lguest
make --jobs 6 -f /dev/null M=tools/lguest ARCH=x86 tools/lguest/lguest 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  tools/lguest/lguest.c   -o tools/lguest/lguest
tools/lguest/lguest.c: In function ‘map_elf’:
tools/lguest/lguest.c:399:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    i, phdr[i].p_memsz, (void *)phdr[i].p_paddr);
                        ^
tools/lguest/lguest.c:88:27: note: in definition of macro ‘verbose’
  do { if (verbose) printf(args); } while(0)
                           ^
tools/lguest/lguest.c: In function ‘blk_request’:
tools/lguest/lguest.c:1660:4: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘off64_t’ [-Wformat=]
    errx(1, "Write past end %llu+%u", off, ret);
    ^
tools/lguest/lguest.c:1658:15: warning: ignoring return value of ‘ftruncate64’, declared with attribute warn_unused_result [-Wunused-result]
    ftruncate64(vblk->fd, vblk->len);
               ^
tools/lguest/lguest.c: In function ‘load_bzimage’:
tools/lguest/lguest.c:431:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
  read(fd, &boot, sizeof(boot));
      ^
tools/lguest/lguest.c: In function ‘run_guest’:
tools/lguest/lguest.c:1837:9: warning: ignoring return value of ‘pread’, declared with attribute warn_unused_result [-Wunused-result]
    pread(lguest_fd, reason, sizeof(reason)-1, cpu_id);
         ^
tools/lguest/lguest.c: In function ‘handle_output’:
tools/lguest/lguest.c:1142:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  write(STDOUT_FILENO, from_guest_phys(addr),
       ^
 * Building tools/vm/slabinfo.c => slabinfo
make --jobs 6 -f /dev/null M=tools/vm ARCH=x86 tools/vm/slabinfo 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  tools/vm/slabinfo.c   -o tools/vm/slabinfo
tools/vm/slabinfo.c: In function ‘read_slab_dir’:
tools/vm/slabinfo.c:1222:9: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
    chdir("..");
         ^
 * Building usr/gen_init_cpio.c => gen_init_cpio
make --jobs 6 -f /dev/null M=usr ARCH=x86 usr/gen_init_cpio 
cc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic  -Wl,-O1 -Wl,--as-needed  usr/gen_init_cpio.c   -o usr/gen_init_cpio
 * Building tools/firewire => nosy-dump
make --jobs 6 -C tools/firewire ARCH=x86 nosy-dump 
make: Entering directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18/tools/firewire'
gcc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -DVERSION=\"0.4\" -I../../drivers/firewire  -c -o nosy-dump.o nosy-dump.c
gcc -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -DVERSION=\"0.4\" -I../../drivers/firewire  -c -o decode-fcp.o decode-fcp.c
nosy-dump.c: In function ‘main’:
nosy-dump.c:990:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
    fread(buf, 1, length, input);
         ^
nosy-dump.c:994:9: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
     read(STDIN_FILENO, &c, sizeof c);
         ^
gcc -Wl,-O1 -Wl,--as-needed  nosy-dump.o decode-fcp.o  -lpopt -o nosy-dump
make: Leaving directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18/tools/firewire'
 * Building tools/power/x86/turbostat => ../../../../turbostat
make --jobs 6 -C tools/power/x86/turbostat ARCH=x86 ../../../../turbostat 
make: Entering directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18/tools/power/x86/turbostat'
make: *** No rule to make target '../../../../turbostat'.  Stop.
make: Leaving directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.18/work/linux-3.18/tools/power/x86/turbostat'
 * ERROR: sys-apps/linux-misc-apps-3.18::gentoo failed (compile phase):
 *   emake failed


# emerge --info
Portage 2.2.15 (python 3.4.2-final-0, default/linux/amd64/13.0, gcc-4.8.4, glibc-2.20-r1, 3.18.1-gentoo x86_64)
=================================================================
System uname: Linux-3.18.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:     4038300 total,   2154784 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of tree: Mon, 29 Dec 2014 12:45:01 +0000
sh bash 4.3_p30-r1
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.3_p30-r1
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.6
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.4
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.4
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20-r1

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode internal-glib python_targets_python3_3 python_targets_python2_7 multilib"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CXXFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic"
DEFAULT_ABI="amd64"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--quiet-build=n --verbose --buildpkg-exclude 'virtual/* net-firewall/xtables-addons'"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GCC_SPECS=""
GRUB_PLATFORMS=""
HOME="/root"
IUSE_IMPLICIT="abi_x86_64 prefix prefix-guest"
KERNEL="linux"
LANG="en_US.UTF-8"
LC_MESSAGES="C"
LC_NUMERIC="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x32="-m elf32_x86_64"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSCOLOR="yes"
LESSCOLORIZER="pygmentize"
LESSOPEN="|lesspipe %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_arm="lib"
LIBDIR_arm64="lib64"
LIBDIR_n32="lib32"
LIBDIR_n64="lib64"
LIBDIR_o32="lib"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_s390="lib32"
LIBDIR_s390x="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x32="libx32"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
LINGUAS="en de"
LOGNAME="root"
MAIL="/var/mail/root"
MAKEOPTS="--jobs 6"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev|systemd|clang|python-exec)"
NOCOLOR="true"
OFFICE_IMPLEMENTATION="libreoffice"
OLDPWD="/root"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4"
PYTHONDONTWRITEBYTECODE="1"
PYTHON_SINGLE_TARGET="python2_7"
PYTHON_TARGETS="python2_7 python3_4"
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4"
RPMDIR="/usr/portage/rpm"
SHELL="/bin/bash"
SHLVL="2"
SYMLINK_LIB="yes"
TERM="screen"
TMUX="/tmp/tmux-0/default,3737,0"
TMUX_PANE="%2"
UNINSTALL_IGNORE="/lib/modules/*"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv idn ipv6 mmx modules multilib ncurses nls nptl openmp pam pcre readline session sse sse2 sse3 sse4 ssl tcpd threads unicode zlib"
ABI_X86="64"
ELIBC="glibc"
INPUT_DEVICES="keyboard mouse evdev"
KERNEL="linux"
LINGUAS="en de"
PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU"
USER="root"
USERLAND="GNU"
USE_EXPAND="ABI_MIPS ABI_PPC ABI_S390 ABI_X86 ALSA_CARDS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS CURL_SSL DRACUT_MODULES DVB_CARDS ELIBC ENLIGHTENMENT_MODULES FCDSL_CARDS FFTOOLS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS GRUB_PLATFORMS INPUT_DEVICES KERNEL LCD_DEVICES LIBREOFFICE_EXTENSIONS LINGUAS LIRC_DEVICES MONKEYD_PLUGINS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL OFED_DRIVERS OFFICE_IMPLEMENTATION OPENMPI_FABRICS OPENMPI_OFED_FEATURES OPENMPI_RM PHP_TARGETS PYTHON_SINGLE_TARGET PYTHON_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND UWSGI_PLUGINS VIDEO_CARDS VOICEMAIL_STORAGE XFCE_PLUGINS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="ABI_MIPS ABI_PPC ABI_S390 CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND"
USE_EXPAND_UNPREFIXED="ARCH"
USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-fbsd amd64-linux arm arm-linux arm64 hppa hppa-hpux ia64 ia64-hpux ia64-linux m68k m68k-mint mips ppc ppc64 ppc64-linux ppc-aix ppc-macos ppc-openbsd s390 sh sparc sparc64-freebsd sparc64-solaris sparc-fbsd sparc-solaris x64-freebsd x64-macos x64-openbsd x64-solaris x86 x86-cygwin x86-fbsd x86-freebsd x86-interix x86-linux x86-macos x86-netbsd x86-openbsd x86-solaris x86-winnt"
USE_EXPAND_VALUES_ELIBC="AIX Cygwin Darwin DragonFly FreeBSD glibc HPUX Interix mintlib musl NetBSD OpenBSD SunOS uclibc Winnt"
USE_EXPAND_VALUES_KERNEL="AIX Cygwin Darwin FreeBSD freemint HPUX Interix linux NetBSD OpenBSD SunOS Winnt"
USE_EXPAND_VALUES_USERLAND="BSD GNU"
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"
VIDEO_CARDS="vmware"
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2014-12-29 21:06:28 UTC
Hi,

I don't understand why

  TARGET_MAKE_SIMPLE=(
    ...
    tools/power/x86/turbostat:turbostat
    ...
  )

became

  TARGET_MAKE_SIMPLE=(
    ...
    tools/power/x86/turbostat:../../../../turbostat
    ...
  )

If we would revert this change, the only left problem is turbostat's Makefile:

  CC              = $(CROSS_COMPILE)gcc
  BUILD_OUTPUT    := $(PWD)
  PREFIX          := /usr
  DESTDIR         :=
  
  turbostat : turbostat.c
  CFLAGS +=       -Wall
  CFLAGS +=       -DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
  
  %: %.c
          @mkdir -p $(BUILD_OUTPUT)
          $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@
  [...]

We call

  make -C tools/power/x86/turbostat ARCH=x86 turbostat

but the "-C" doesn't update the used $PWD variable, therefore our logic in src_install function would fail.

Patch suggestion:

--- linux-misc-apps-3.18.ebuild.old     2014-12-29 21:09:58.000000000 +0100
+++ linux-misc-apps-3.18.ebuild 2014-12-29 21:46:28.000000000 +0100
@@ -69,7 +69,7 @@
 # These have a broken make install, no DESTDIR
 TARGET_MAKE_SIMPLE=(
        tools/firewire:nosy-dump
-       tools/power/x86/turbostat:../../../../turbostat
+       tools/power/x86/turbostat:turbostat
        tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
        Documentation/misc-devices/mei:mei-amt-version
 )
@@ -135,7 +135,7 @@
        for t in ${TARGET_MAKE_SIMPLE[@]} ; do
                dir=${t/:*} target=${t/*:}
                einfo "Building $dir => $target"
-               emake -C $dir ARCH=${karch} $target
+               emake -C $dir BUILD_OUTPUT=. ARCH=${karch} $target
        done
 }


...we could also patch the Makefile in src_prepare, i.e. 

  s/BUILD_OUTPUT    := $(PWD)/BUILD_OUTPUT    := $(shell pwd)/
Comment 2 Gary E. Miller 2014-12-30 00:02:02 UTC
> upgrading sys-apps/linux-misc-apps from v3.6-r2 to v3.18 failed:

+1
Comment 3 Tamas Jantvik 2014-12-30 10:08:47 UTC
Applying the proposed ebuild patch enables build and install for me.
Comment 4 Martin von Gagern 2015-01-03 21:31:28 UTC
(In reply to Thomas D. from comment #1)
> ...we could also patch the Makefile in src_prepare, i.e. 
> 
>   s/BUILD_OUTPUT    := $(PWD)/BUILD_OUTPUT    := $(shell pwd)/

Your first suggestion appears to work well enough for me. But if there is any reason to prefer something like this second suggestion, how about using the GNU extension $(CURDIR) instead of $(PWD) or $(shell pwd)?
Comment 5 Klaus Kusche 2015-01-04 10:30:48 UTC
Same problem here.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2015-01-04 18:12:06 UTC
@ Martin:

I agree with you. $CURDIR should be used. Wasn't sure if we can "depend" on GNU make (also, many Makefiles in kernel source uses multiple variants) but according to the documentation, GNU make is a requirement.

I send the patch to upstream, http://thread.gmane.org/gmane.linux.kernel/1858252

If this will be accepted I don't expect to see it before sys-apps/linux-misc-apps-3.19.


@ Robin:
Would be nice if you could revert the TARGET_MAKE_SIMPLE change in the ebuild, i.e.

--- linux-misc-apps-3.18.ebuild.old     2014-12-29 21:09:58.000000000 +0100
+++ linux-misc-apps-3.18.ebuild 2014-12-29 21:46:28.000000000 +0100
@@ -69,7 +69,7 @@
 # These have a broken make install, no DESTDIR
 TARGET_MAKE_SIMPLE=(
        tools/firewire:nosy-dump
-       tools/power/x86/turbostat:../../../../turbostat
+       tools/power/x86/turbostat:turbostat
        tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
        Documentation/misc-devices/mei:mei-amt-version
 )

and apply the patch send to upstream.

Thanks!
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-11 12:05:15 UTC
*** Bug 536202 has been marked as a duplicate of this bug. ***
Comment 8 s7v7nislands 2015-02-12 06:35:36 UTC
pump!
Comment 9 Tom Li 2015-02-14 07:04:03 UTC
Tried with Linux 3.19, the issue is not resolved

>>> Emerging (1 of 1) sys-apps/linux-misc-apps-3.19::local
 * linux-3.19.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                                                                              [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.19.0-e/build
 * Found sources for kernel version:
 *     3.19.0-e
>>> Unpacking source...
>>> Unpacking linux-3.19.tar.xz to /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work
>>> Source unpacked in /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work
/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19 /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work
/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work
>>> Preparing source in /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19 ...
 * Building Documentation/accounting/getdelays.c => getdelays
make -j2 -f /dev/null M=Documentation/accounting ARCH=x86 Documentation/accounting/getdelays 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  Documentation/accounting/getdelays.c   -o Documentation/accounting/getdelays
 * Building tools/cgroup/cgroup_event_listener.c => cgroup_event_listener
make -j2 -f /dev/null M=tools/cgroup ARCH=x86 tools/cgroup/cgroup_event_listener 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  tools/cgroup/cgroup_event_listener.c   -o tools/cgroup/cgroup_event_listener
 * Building Documentation/laptops/dslm.c => dslm
make -j2 -f /dev/null M=Documentation/laptops ARCH=x86 Documentation/laptops/dslm 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  Documentation/laptops/dslm.c   -o Documentation/laptops/dslm
 * Building Documentation/laptops/freefall.c => freefall
make -j2 -f /dev/null M=Documentation/laptops ARCH=x86 Documentation/laptops/freefall 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  Documentation/laptops/freefall.c   -o Documentation/laptops/freefall
 * Building Documentation/networking/timestamping/timestamping.c => timestamping
make -j2 -f /dev/null M=Documentation/networking/timestamping ARCH=x86 Documentation/networking/timestamping/timestamping 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  Documentation/networking/timestamping/timestamping.c   -o Documentation/networking/timestamping/timestamping
 * Building Documentation/watchdog/src/watchdog-simple.c => watchdog-simple
make -j2 -f /dev/null M=Documentation/watchdog/src ARCH=x86 Documentation/watchdog/src/watchdog-simple 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  Documentation/watchdog/src/watchdog-simple.c   -o Documentation/watchdog/src/watchdog-simple
 * Building tools/lguest/lguest.c => lguest
make -j2 -f /dev/null M=tools/lguest ARCH=x86 tools/lguest/lguest 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  tools/lguest/lguest.c   -o tools/lguest/lguest
tools/lguest/lguest.c: In function ‘map_elf’:
tools/lguest/lguest.c:399:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    i, phdr[i].p_memsz, (void *)phdr[i].p_paddr);
                        ^
tools/lguest/lguest.c:88:27: note: in definition of macro ‘verbose’
  do { if (verbose) printf(args); } while(0)
                           ^
tools/lguest/lguest.c: In function ‘blk_request’:
tools/lguest/lguest.c:1660:4: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘off64_t’ [-Wformat=]
    errx(1, "Write past end %llu+%u", off, ret);
    ^
tools/lguest/lguest.c:1658:4: warning: ignoring return value of ‘ftruncate64’, declared with attribute warn_unused_result [-Wunused-result]
    ftruncate64(vblk->fd, vblk->len);
    ^
tools/lguest/lguest.c: In function ‘load_bzimage’:
tools/lguest/lguest.c:431:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
  read(fd, &boot, sizeof(boot));
  ^
tools/lguest/lguest.c: In function ‘run_guest’:
tools/lguest/lguest.c:1837:4: warning: ignoring return value of ‘pread’, declared with attribute warn_unused_result [-Wunused-result]
    pread(lguest_fd, reason, sizeof(reason)-1, cpu_id);
    ^
tools/lguest/lguest.c: In function ‘handle_output’:
tools/lguest/lguest.c:1142:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  write(STDOUT_FILENO, from_guest_phys(addr),
  ^
 * Building tools/vm/slabinfo.c => slabinfo
make -j2 -f /dev/null M=tools/vm ARCH=x86 tools/vm/slabinfo 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  tools/vm/slabinfo.c   -o tools/vm/slabinfo
tools/vm/slabinfo.c: In function ‘read_slab_dir’:
tools/vm/slabinfo.c:1222:4: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
    chdir("..");
    ^
 * Building usr/gen_init_cpio.c => gen_init_cpio
make -j2 -f /dev/null M=usr ARCH=x86 usr/gen_init_cpio 
cc -march=native -O2 -pipe  -Wl,-O1 -Wl,--as-needed  usr/gen_init_cpio.c   -o usr/gen_init_cpio
 * Building tools/firewire => nosy-dump
make -j2 -C tools/firewire ARCH=x86 nosy-dump 
make: Entering directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19/tools/firewire'
gcc -march=native -O2 -pipe -DVERSION=\"0.4\" -I../../drivers/firewire  -c -o nosy-dump.o nosy-dump.c
gcc -march=native -O2 -pipe -DVERSION=\"0.4\" -I../../drivers/firewire  -c -o decode-fcp.o decode-fcp.c
nosy-dump.c: In function ‘main’:
nosy-dump.c:990:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
    fread(buf, 1, length, input);
    ^
nosy-dump.c:994:5: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
     read(STDIN_FILENO, &c, sizeof c);
     ^
gcc -Wl,-O1 -Wl,--as-needed  nosy-dump.o decode-fcp.o  -lpopt -o nosy-dump
make: Leaving directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19/tools/firewire'
 * Building tools/power/x86/turbostat => ../../../../turbostat
make -j2 -C tools/power/x86/turbostat ARCH=x86 ../../../../turbostat 
make: Entering directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19/tools/power/x86/turbostat'
make: *** No rule to make target '../../../../turbostat'.  Stop.
make: Leaving directory '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19/tools/power/x86/turbostat'
 * ERROR: sys-apps/linux-misc-apps-3.19::local failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/linux-misc-apps-3.19::local'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/linux-misc-apps-3.19::local'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19'
 * S: '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19'

>>> Failed to emerge sys-apps/linux-misc-apps-3.19, Log file:

>>>  '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/temp/build.log'

 * Messages for package sys-apps/linux-misc-apps-3.19:

 * ERROR: sys-apps/linux-misc-apps-3.19::local failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/linux-misc-apps-3.19::local'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/linux-misc-apps-3.19::local'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19'
 * S: '/var/tmp/portage/sys-apps/linux-misc-apps-3.19/work/linux-3.19'
Comment 10 Jan Psota 2015-02-14 08:40:56 UTC
Created attachment 396438 [details, diff]
turbostat build fix + usbip

1. Turbostat build fix:

TARGET_MAKE_SIMPLE=
-       tools/power/x86/turbostat:../../../../turbostat
+       tools/power/x86/turbostat:turbostat

in src_prepare()
+       sed -i -e 's/\(BUILD_OUTPUT.*:= \)$(PWD)/\1./' tools/power/x86/turbostat/Makefile

2. There is no usbip package - so fixes the rest of a patch.
Comment 11 Martin Mokrejš 2015-03-17 13:10:33 UTC
(In reply to Jan Psota from comment #10)
> Created attachment 396438 [details, diff] [details, diff]
> turbostat build fix + usbip
> 
> 1. Turbostat build fix:
> 
> TARGET_MAKE_SIMPLE=
> -       tools/power/x86/turbostat:../../../../turbostat
> +       tools/power/x86/turbostat:turbostat
> 
> in src_prepare()
> +       sed -i -e 's/\(BUILD_OUTPUT.*:= \)$(PWD)/\1./'
> tools/power/x86/turbostat/Makefile
> 
> 2. There is no usbip package - so fixes the rest of a patch.


I tested this patch. It fixes the turbostat issue but I get a bit later:

make -j2 -C tools/usb/usbip 
make: Entering directory '/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/tools/usb/usbip'
make  all-recursive
make[1]: Entering directory '/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/tools/usb/usbip'
Making all in libsrc
make[2]: Entering directory '/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/tools/usb/usbip/libsrc'
/bin/sh ../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -DUSBIDS_FILE='"/usr/share/misc/usb.ids"'  -Wall -Werror -Wextra -std=gnu99 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -c -o libusbip_la-names.lo `test -f 'names.c' || echo './'`names.c
/bin/sh ../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -DUSBIDS_FILE='"/usr/share/misc/usb.ids"'  -Wall -Werror -Wextra -std=gnu99 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -c -o libusbip_la-usbip_host_driver.lo `test -f 'usbip_host_driver.c' || echo './'`usbip_host_driver.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DUSBIDS_FILE=\"/usr/share/misc/usb.ids\" -Wall -Werror -Wextra -std=gnu99 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -c names.c  -fPIC -DPIC -o .libs/libusbip_la-names.o
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DUSBIDS_FILE=\"/usr/share/misc/usb.ids\" -Wall -Werror -Wextra -std=gnu99 -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -c usbip_host_driver.c  -fPIC -DPIC -o .libs/libusbip_la-usbip_host_driver.o
In file included from names.c:41:0:
usbip_common.h:18:25: fatal error: linux/usbip.h: No such file or directory
 #include <linux/usbip.h>
                         ^
compilation terminated.
Makefile:430: recipe for target 'libusbip_la-names.lo' failed
make[2]: *** [libusbip_la-names.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from usbip_host_driver.c:28:0:
usbip_common.h:18:25: fatal error: linux/usbip.h: No such file or directory
 #include <linux/usbip.h>
                         ^
compilation terminated.
Makefile:437: recipe for target 'libusbip_la-usbip_host_driver.lo' failed
make[2]: *** [libusbip_la-usbip_host_driver.lo] Error 1
make[2]: Leaving directory '/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/tools/usb/usbip/libsrc'
Comment 12 Jan Psota 2015-03-17 15:56:36 UTC
(In reply to Martin Mokrejš from comment #11)
> (In reply to Jan Psota from comment #10)
> > Created attachment 396438 [details, diff] [details, diff] [details, diff]

> I tested this patch. It fixes the turbostat issue but I get a bit later:
> In file included from names.c:41:0:
> usbip_common.h:18:25: fatal error: linux/usbip.h: No such file or directory

Strange... There is linux/usbip.h in sys-kernel/linux-headers-3.19
(in kernel sources usbip.h is in uapi/linux/ and is identical)

Patched linux-misc-apps-3.18 renamed to ...-3.19 works for me, too.
Comment 13 Martin Mokrejš 2015-03-17 17:27:27 UTC
(In reply to Jan Psota from comment #12)
> (In reply to Martin Mokrejš from comment #11)
> > (In reply to Jan Psota from comment #10)
> > > Created attachment 396438 [details, diff] [details, diff] [details, diff] [details, diff]
> 
> > I tested this patch. It fixes the turbostat issue but I get a bit later:
> > In file included from names.c:41:0:
> > usbip_common.h:18:25: fatal error: linux/usbip.h: No such file or directory
> 
> Strange... There is linux/usbip.h in sys-kernel/linux-headers-3.19
> (in kernel sources usbip.h is in uapi/linux/ and is identical)
> 
> Patched linux-misc-apps-3.18 renamed to ...-3.19 works for me, too.

# find /mnt/1TB/var/tmp/portage/sys-apps/ -name usbip.h                        
/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/include/uapi/linux/usbip.h
/mnt/1TB/var/tmp/portage/sys-apps/linux-misc-apps-3.18-r1/work/linux-3.18/tools/usb/usbip/src/usbip.h
#

I think the 'gcc -I path' has to reflect the correct location. $CWD was [cut]/linux-3.18/tools/usb/usbip/libsrc while the command was:

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. [cut]

There should be -I../../../../include/uapi if I get it right.
Comment 14 Jan Psota 2015-03-17 20:41:50 UTC
We go it! :-) Too old sys-kernel/linux-headers-3.12 had no usbip.h
Comment 15 Jan Psota 2015-03-17 20:42:25 UTC
"got"...
Comment 16 s7v7nislands 2015-04-17 07:57:47 UTC
still failed while using kernel-4.0.0

$ uname -sr
Linux 4.0.0-gentoo
Comment 17 Thomas Deutschmann (RETIRED) gentoo-dev 2015-05-06 23:42:38 UTC
Created attachment 402800 [details, diff]
Patch against linux-misc-apps-3.18 with turbostat fix + usbip

Hi,

upstream has accepted my patch. It is now available in every released kernel.

I am attaching an updated patch. For better reviewing, the patch is build against linux-misc-apps-3.18. But the resulting ebuild only works with >=linux-4.0.2.

I included the usbip addition from Jan.

I also added a patch for lguest to respect our CFLAGS.
Comment 18 Jan Psota 2015-05-07 00:06:20 UTC
> I included the usbip addition from Jan.
Hihi... Looks like we have net-misc/usbip (3.19 - I didn't tested it) in portage since march 17-th, so we can remove it from linux-misc-apps now :-)

Thank you for your work! :-)
Comment 19 Thomas Deutschmann (RETIRED) gentoo-dev 2015-05-07 16:01:09 UTC
Well, looks like the usbip thing should handled in an own bug. However I contacted Chí-Thanh and asked him if usbip should be integrated.


@ Robin:
I'd also like to convert linux-misc-apps ebuild to use linux-2 eclass. Currently the ebuild would download the full kernel source. With the linux-2 eclass we could re-use existing linux sources and patch sets from other ebuilds.
Comment 20 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-05-07 16:40:09 UTC
(In reply to Thomas D. from comment #19)
The integration of usbip into linux-misc-apps is handled in bug 395871. It would be better to restrict this bug to the build failure and not bring in any unrelated issues.

Note that usbip was integrated once already, and usbip removed from the portage tree. But at some point usbip was dropped again from linux-misc-apps which is why I added it again as its own package.
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-11 00:32:33 UTC
Fixed in 4.4 build. Handling usbip elsewhere.