[oe-commits] [openembedded-core] 54/65: perf: make a copy of kernel source to perf workdir

git at git.openembedded.org git at git.openembedded.org
Wed Aug 15 09:23:58 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch rocko
in repository openembedded-core.

commit 6f9117c0bceeedbfce08647825edf86966457bfc
Author: Hongxu Jia <hongxu.jia at windriver.com>
AuthorDate: Tue Apr 24 11:33:47 2018 +0800

    perf: make a copy of kernel source to perf workdir
    
    Since perf contaminates linux shared workdir, it probably caused
    kernel-devsrc compile failure at world build.
    ...
    |0 blocks
    |cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
    No such file or directory
    |0 blocks
    ...
    cpio tried to find a file at ${S}/tools/perf and failed
    if the input list is not valid.
    
    Make a copy of kernel shared source directory into a perf workdir
    could fix the issue.
    
    Drop `Fix for rebuilding' which is obsolete
    
    [YOCTO #10880]
    
    (From OE-Core rev: 9b38c824961fc9dce51bda95c25dac91a69fc64f)
    
    (From OE-Core rev: 1a39330bf79f3d36a1a0f6d34b421de53ff36405)
    
    Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/recipes-kernel/perf/perf.bb | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 0df087b..b3aa509 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -59,7 +59,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version
 
 inherit kernelsrc
 
-B = "${WORKDIR}/${BPN}-${PV}"
+S = "${WORKDIR}/${BP}"
 SPDX_S = "${S}/tools/perf"
 
 # The LDFLAGS is required or some old kernels fails due missing
@@ -95,6 +95,16 @@ EXTRA_OEMAKE += "\
     'infodir=${@os.path.relpath(infodir, prefix)}' \
 "
 
+PERF_SRC ?= "Makefile \
+             tools/arch \
+             tools/build \
+             tools/include \
+             tools/lib \
+             tools/Makefile \
+             tools/perf \
+             tools/scripts \
+"
+
 PERF_EXTRA_LDFLAGS = ""
 
 # MIPS N32
@@ -117,11 +127,22 @@ do_install() {
 	fi
 }
 
-do_configure_prepend () {
-    # Fix for rebuilding
-    rm -rf ${B}/
-    mkdir -p ${B}/
+do_configure[prefuncs] += "copy_perf_source_from_kernel"
+python copy_perf_source_from_kernel() {
+    sources = (d.getVar("PERF_SRC") or "").split()
+    src_dir = d.getVar("STAGING_KERNEL_DIR")
+    dest_dir = d.getVar("S")
+    bb.utils.mkdirhier(dest_dir)
+    for s in sources:
+        src = oe.path.join(src_dir, s)
+        dest = oe.path.join(dest_dir, s)
+        if os.path.isdir(src):
+            oe.path.copyhardlinktree(src, dest)
+        else:
+            bb.utils.copyfile(src, dest)
+}
 
+do_configure_prepend () {
     # If building a multlib based perf, the incorrect library path will be
     # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
     # build, with a 64 bit multilib, the arch won't match and the detection of a 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list