summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile/oprofile
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-01-08 14:22:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:30 +0000
commitf2856a121258ef6b3aa5450fadecf7b4c4ab4d53 (patch)
tree8213afbfa30288895d6ee9464fcef29cdb3f123d /meta/recipes-kernel/oprofile/oprofile
parent226c45083eef598355aceb5500cbc62520a7302d (diff)
downloadpoky-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/oprofile/oprofile')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/musl.patch46
1 files changed, 46 insertions, 0 deletions
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 @@
1Fix glibc-isms so that oprofile builds with musl.
2
3Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch)
4
5Upstream-Status: Pending
6Signed-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);