diff options
Diffstat (limited to 'meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch')
-rw-r--r-- | meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch new file mode 100644 index 000000000..61191220e --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 5ed9bda8baf7465172a99ff86ed7f46397b06c7f Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrew Savchenko <bircoph@gmail.com> | ||
3 | Date: Sat, 5 Sep 2020 14:41:30 +0300 | ||
4 | Subject: [PATCH 01/10] Fix build with musl | ||
5 | |||
6 | --Signature=_Sat__5_Sep_2020_14_41_30_+0300_B.qpPPwu83bbA.32 | ||
7 | Content-Type: text/plain; charset=US-ASCII | ||
8 | Content-Disposition: inline | ||
9 | Content-Transfer-Encoding: quoted-printable | ||
10 | |||
11 | When musl is used instead of glibc, oprofile build fails because it | ||
12 | uses glibc-specific FTW extension: FTW_ACTIONRETVAL for custom | ||
13 | __delete_old_previous_sample_data return codes and FTW_STOP, | ||
14 | FTW_CONTINUE for such return codes. Musl supports only POSIX ftw, so | ||
15 | build fails. | ||
16 | |||
17 | However, this extension is not really needed by oprofile, because | ||
18 | FTW_SKIP_* are not used and {FTW_STOP,FTW_CONTINUE} can be handled | ||
19 | by standard return codes {1,0} (more precisely standard defines | ||
20 | {!0,0}, but in glibc FTW_STOP = 1, so I keep this value). | ||
21 | |||
22 | Upstream-Status: Backport [https://sourceforge.net/p/oprofile/oprofile/ci/5ed9bda8baf7465172a99ff86ed7f46397b06c7f/] | ||
23 | Signed-off-by: Andrew Savchenko <bircoph@gmail.com> | ||
24 | --- | ||
25 | pe_profiling/operf.cpp | 6 +++--- | ||
26 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
27 | |||
28 | diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp | ||
29 | index 06a0ea3c..00834409 100644 | ||
30 | --- a/pe_profiling/operf.cpp | ||
31 | +++ b/pe_profiling/operf.cpp | ||
32 | @@ -860,9 +860,9 @@ static int __delete_old_previous_sample_data(const char *fpath, | ||
33 | { | ||
34 | if (remove(fpath)) { | ||
35 | perror("sample data removal error"); | ||
36 | - return FTW_STOP; | ||
37 | + return 1; | ||
38 | } else { | ||
39 | - return FTW_CONTINUE; | ||
40 | + return 0; | ||
41 | } | ||
42 | } | ||
43 | |||
44 | @@ -897,7 +897,7 @@ static void convert_sample_data(void) | ||
45 | return; | ||
46 | |||
47 | if (!operf_options::append) { | ||
48 | - int flags = FTW_DEPTH | FTW_ACTIONRETVAL; | ||
49 | + int flags = FTW_DEPTH; | ||
50 | errno = 0; | ||
51 | if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 && | ||
52 | errno != ENOENT) { | ||
53 | -- | ||
54 | 2.31.0 | ||
55 | |||