diff options
author | Victor Kamensky <kamensky@cisco.com> | 2018-04-05 11:25:28 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-04-07 11:44:50 +0100 |
commit | 77f69397e02826d3ac9ad69285bca6bc2b56d85c (patch) | |
tree | d07ccec0ef0eecf2aef5dce747dfbf1d092be4e4 /meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch | |
parent | 7ca5822635e3123571fac7f99f5d6340274f84e9 (diff) | |
download | poky-77f69397e02826d3ac9ad69285bca6bc2b56d85c.tar.gz |
systemtap: support --sysroot option in variety of situations in cross build
For details on issues fixed please look at commit message of individual
patches.
Upstream-Status: Backport [systemtap@sourceware.org]
(From OE-Core rev: 5aa93de3a79c8691e74e982d3d4b0099b04f5555)
Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch')
-rw-r--r-- | meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch b/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch new file mode 100644 index 0000000000..b31d6274e2 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From a9ce89bcd2d78728faef59bda60e75510972cd56 Mon Sep 17 00:00:00 2001 | ||
2 | From: Victor Kamensky <kamensky@cisco.com> | ||
3 | Date: Wed, 14 Mar 2018 17:09:44 -0500 | ||
4 | Subject: [PATCH] sysroot: fix short release -r option handling | ||
5 | |||
6 | * setupdwfl.cxx (debuginfo_path_insert_sysroot): Add a '/' to the end of | ||
7 | the sysroot for path_insert_sysroot(). | ||
8 | (setup_dwfl_kernel): Simplify logic when finding the kernel path to send | ||
9 | to elfutils. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | Signed-off-by: Victor Kamensky <kamensky@cisco.com> | ||
13 | --- | ||
14 | setupdwfl.cxx | 19 ++++++++++++------- | ||
15 | 1 file changed, 12 insertions(+), 7 deletions(-) | ||
16 | |||
17 | diff --git a/setupdwfl.cxx b/setupdwfl.cxx | ||
18 | index 2a87982..f6c3157 100644 | ||
19 | --- a/setupdwfl.cxx | ||
20 | +++ b/setupdwfl.cxx | ||
21 | @@ -339,6 +339,13 @@ static char * path_insert_sysroot(string sysroot, string path) | ||
22 | |||
23 | void debuginfo_path_insert_sysroot(string sysroot) | ||
24 | { | ||
25 | + // FIXME: This is a short-term fix, until we expect sysroot paths to | ||
26 | + // always end with a '/' (and never be empty). | ||
27 | + // | ||
28 | + // The path_insert_sysroot() function assumes that sysroot has a '/' | ||
29 | + // on the end. Make sure that is true. | ||
30 | + if (sysroot.back() != '/') | ||
31 | + sysroot.push_back('/'); | ||
32 | debuginfo_path = path_insert_sysroot(sysroot, debuginfo_path); | ||
33 | debuginfo_usr_path = path_insert_sysroot(sysroot, debuginfo_usr_path); | ||
34 | } | ||
35 | @@ -358,13 +365,11 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s) | ||
36 | // no way to set the dwfl_callback.debuginfo_path and always | ||
37 | // passs the plain kernel_release here. So instead we have to | ||
38 | // hard-code this magic here. | ||
39 | - string lib_path = "/lib/modules/" + s.kernel_release + "/build"; | ||
40 | - if (s.kernel_build_tree == string(s.sysroot + lib_path) || | ||
41 | - (s.kernel_build_tree == lib_path | ||
42 | - && s.sysroot == "/")) | ||
43 | - elfutils_kernel_path = s.kernel_release; | ||
44 | - else | ||
45 | - elfutils_kernel_path = s.kernel_build_tree; | ||
46 | + string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build"; | ||
47 | + if (s.kernel_build_tree == lib_path) | ||
48 | + elfutils_kernel_path = s.kernel_release; | ||
49 | + else | ||
50 | + elfutils_kernel_path = s.kernel_build_tree; | ||
51 | offline_modules_found = 0; | ||
52 | |||
53 | // First try to report full path modules. | ||