diff options
author | Ross Burton <ross.burton@intel.com> | 2016-01-08 14:22:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-24 09:40:30 +0000 |
commit | f2856a121258ef6b3aa5450fadecf7b4c4ab4d53 (patch) | |
tree | 8213afbfa30288895d6ee9464fcef29cdb3f123d /meta/recipes-kernel | |
parent | 226c45083eef598355aceb5500cbc62520a7302d (diff) | |
download | poky-f2856a121258ef6b3aa5450fadecf7b4c4ab4d53.tar.gz |
oprofile: fix build with musl
(From OE-Core rev: 0b1b091bcfee268773002e8f015ead77c9de953a)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r-- | meta/recipes-kernel/oprofile/oprofile.inc | 2 | ||||
-rw-r--r-- | meta/recipes-kernel/oprofile/oprofile/musl.patch | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile.inc b/meta/recipes-kernel/oprofile/oprofile.inc index 6ec56e7b33..faf0e53fe5 100644 --- a/meta/recipes-kernel/oprofile/oprofile.inc +++ b/meta/recipes-kernel/oprofile/oprofile.inc | |||
@@ -25,6 +25,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ | |||
25 | file://run-ptest \ | 25 | file://run-ptest \ |
26 | file://root-home-dir.patch" | 26 | file://root-home-dir.patch" |
27 | 27 | ||
28 | SRC_URI_append_libc-musl = " file://musl.patch" | ||
29 | |||
28 | inherit autotools pkgconfig ptest | 30 | inherit autotools pkgconfig ptest |
29 | 31 | ||
30 | EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC=" | 32 | EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC=" |
diff --git a/meta/recipes-kernel/oprofile/oprofile/musl.patch b/meta/recipes-kernel/oprofile/oprofile/musl.patch new file mode 100644 index 0000000000..51db408454 --- /dev/null +++ b/meta/recipes-kernel/oprofile/oprofile/musl.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Fix glibc-isms so that oprofile builds with musl. | ||
2 | |||
3 | Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch) | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
7 | |||
8 | --- a/pe_profiling/operf.cpp | ||
9 | +++ b/pe_profiling/operf.cpp | ||
10 | @@ -857,11 +857,14 @@ static int __delete_old_previous_sample_ | ||
11 | int tflag __attribute__((unused)), | ||
12 | struct FTW *ftwbuf __attribute__((unused))) | ||
13 | { | ||
14 | + int err; | ||
15 | + | ||
16 | if (remove(fpath)) { | ||
17 | + err = errno; | ||
18 | perror("sample data removal error"); | ||
19 | - return FTW_STOP; | ||
20 | + return err; | ||
21 | } else { | ||
22 | - return FTW_CONTINUE; | ||
23 | + return 0; | ||
24 | } | ||
25 | } | ||
26 | |||
27 | @@ -896,7 +899,7 @@ static void convert_sample_data(void) | ||
28 | return; | ||
29 | |||
30 | if (!operf_options::append) { | ||
31 | - int flags = FTW_DEPTH | FTW_ACTIONRETVAL; | ||
32 | + int flags = FTW_DEPTH; | ||
33 | errno = 0; | ||
34 | if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 && | ||
35 | errno != ENOENT) { | ||
36 | --- a/libop/op_events.c | ||
37 | +++ b/libop/op_events.c | ||
38 | @@ -83,7 +83,7 @@ static int parse_hex(char const * str) | ||
39 | static u64 parse_long_hex(char const * str) | ||
40 | { | ||
41 | u64 value; | ||
42 | - if (sscanf(str, "%Lx", &value) != 1) | ||
43 | + if (sscanf(str, "0x%llx", &value) != 1) | ||
44 | parse_error("expected long hexadecimal value"); | ||
45 | |||
46 | fflush(stderr); | ||