diff options
| author | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2020-03-04 16:26:07 +0000 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-03-04 18:14:12 -0300 |
| commit | db9237d9d60d2f281d25bf4f1c7569002e407ca2 (patch) | |
| tree | 209888de9a3b7cf4a870dc0ee32b7949c8d3e635 | |
| parent | ca1533819c3c5a6cd055e5719a5030daa896262a (diff) | |
| download | meta-freescale-db9237d9d60d2f281d25bf4f1c7569002e407ca2.tar.gz | |
linux-imx: backport patch to fix perf build with latest binutils
Backport upstream patch, which solves the perf build issue when new
binutils are included.
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
| -rw-r--r-- | recipes-kernel/linux/linux-imx-4.19.35/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch | 61 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-imx_4.19.35.bb | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-imx-4.19.35/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch b/recipes-kernel/linux/linux-imx-4.19.35/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch new file mode 100644 index 000000000..db0dc57a5 --- /dev/null +++ b/recipes-kernel/linux/linux-imx-4.19.35/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changbin Du <changbin.du@gmail.com> | ||
| 3 | Date: Tue, 28 Jan 2020 23:29:38 +0800 | ||
| 4 | Subject: [PATCH] perf: Make perf able to build with latest libbfd | ||
| 5 | |||
| 6 | libbfd has changed the bfd_section_* macros to inline functions | ||
| 7 | bfd_section_<field> since 2019-09-18. See below two commits: | ||
| 8 | o http://www.sourceware.org/ml/gdb-cvs/2019-09/msg00064.html | ||
| 9 | o https://www.sourceware.org/ml/gdb-cvs/2019-09/msg00072.html | ||
| 10 | |||
| 11 | This fix make perf able to build with both old and new libbfd. | ||
| 12 | |||
| 13 | Signed-off-by: Changbin Du <changbin.du@gmail.com> | ||
| 14 | Acked-by: Jiri Olsa <jolsa@redhat.com> | ||
| 15 | Cc: Peter Zijlstra <peterz@infradead.org> | ||
| 16 | Link: http://lore.kernel.org/lkml/20200128152938.31413-1-changbin.du@gmail.com | ||
| 17 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
| 18 | Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | ||
| 19 | --- | ||
| 20 | tools/perf/util/srcline.c | 16 +++++++++++++++- | ||
| 21 | 1 file changed, 15 insertions(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c | ||
| 24 | index 6ccf6f6d09df..5b7d6c16d33f 100644 | ||
| 25 | --- a/tools/perf/util/srcline.c | ||
| 26 | +++ b/tools/perf/util/srcline.c | ||
| 27 | @@ -193,16 +193,30 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data) | ||
| 28 | bfd_vma pc, vma; | ||
| 29 | bfd_size_type size; | ||
| 30 | struct a2l_data *a2l = data; | ||
| 31 | + flagword flags; | ||
| 32 | |||
| 33 | if (a2l->found) | ||
| 34 | return; | ||
| 35 | |||
| 36 | - if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) | ||
| 37 | +#ifdef bfd_get_section_flags | ||
| 38 | + flags = bfd_get_section_flags(abfd, section); | ||
| 39 | +#else | ||
| 40 | + flags = bfd_section_flags(section); | ||
| 41 | +#endif | ||
| 42 | + if ((flags & SEC_ALLOC) == 0) | ||
| 43 | return; | ||
| 44 | |||
| 45 | pc = a2l->addr; | ||
| 46 | +#ifdef bfd_get_section_vma | ||
| 47 | vma = bfd_get_section_vma(abfd, section); | ||
| 48 | +#else | ||
| 49 | + vma = bfd_section_vma(section); | ||
| 50 | +#endif | ||
| 51 | +#ifdef bfd_get_section_size | ||
| 52 | size = bfd_get_section_size(section); | ||
| 53 | +#else | ||
| 54 | + size = bfd_section_size(section); | ||
| 55 | +#endif | ||
| 56 | |||
| 57 | if (pc < vma || pc >= vma + size) | ||
| 58 | return; | ||
| 59 | -- | ||
| 60 | 2.17.1 | ||
| 61 | |||
diff --git a/recipes-kernel/linux/linux-imx_4.19.35.bb b/recipes-kernel/linux/linux-imx_4.19.35.bb index dd69aba5f..d1f3aa4ea 100644 --- a/recipes-kernel/linux/linux-imx_4.19.35.bb +++ b/recipes-kernel/linux/linux-imx_4.19.35.bb | |||
| @@ -19,6 +19,7 @@ LOCALVERSION = "-1.1.0" | |||
| 19 | SRCREV = "0f9917c56d5995e1dc3bde5658e2d7bc865464de" | 19 | SRCREV = "0f9917c56d5995e1dc3bde5658e2d7bc865464de" |
| 20 | SRC_URI += "file://0001-Compiler-Attributes-add-support-for-__copy-gcc-9.patch \ | 20 | SRC_URI += "file://0001-Compiler-Attributes-add-support-for-__copy-gcc-9.patch \ |
| 21 | file://0002-include-linux-module.h-copy-__init-__exit-attrs-to-i.patch \ | 21 | file://0002-include-linux-module.h-copy-__init-__exit-attrs-to-i.patch \ |
| 22 | file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch \ | ||
| 22 | " | 23 | " |
| 23 | 24 | ||
| 24 | DEFAULT_PREFERENCE = "1" | 25 | DEFAULT_PREFERENCE = "1" |
