summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-02-25 14:33:17 +0100
committerAndrei Gherzan <andrei@gherzan.ro>2020-02-25 19:55:21 +0000
commitb422a0ae50a3960fd9cd0c6c03a40535ac4931a6 (patch)
treef8ad9f5ee3dbdc3a520b876a1874e9bd71f120ee
parent7a8c76f056ee3c64441f6832c9ea708d081d5392 (diff)
downloadmeta-raspberrypi-b422a0ae50a3960fd9cd0c6c03a40535ac4931a6.tar.gz
linux-raspberrypi: fix perf build with latest binutils
* fixes: | LINK /OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/perf | /OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/libperf.a(libperf-in.o):srcline.c:function find_address_in_section: error: undefined reference to 'bfd_get_section_flags' | /OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/libperf.a(libperf-in.o):srcline.c:function find_address_in_section: error: undefined reference to 'bfd_get_section_vma' | /OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/libperf.a(libperf-in.o):srcline.c:function find_address_in_section: error: undefined reference to 'bfd_get_section_size' | collect2: error: ld returned 1 exit status | make[2]: *** [Makefile.perf:519: /OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/perf] Error 1 | make[1]: *** [Makefile.perf:206: sub-make] Error 2 | make: *** [Makefile:70: all] Error 2 | make: Leaving directory '/OE/build/oe-core/tmp-glibc/work/raspberrypi4-oe-linux-gnueabi/perf/1.0-r9/perf-1.0/tools/perf' | WARNING: exit code 1 from a shell command. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--recipes-kernel/linux/files/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch57
-rw-r--r--recipes-kernel/linux/linux-raspberrypi_4.19.bb2
2 files changed, 59 insertions, 0 deletions
diff --git a/recipes-kernel/linux/files/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch b/recipes-kernel/linux/files/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
new file mode 100644
index 0000000..e0e7b85
--- /dev/null
+++ b/recipes-kernel/linux/files/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
@@ -0,0 +1,57 @@
1From e66a0be4fac135d67ab228a6fd1453b9e36a3644 Mon Sep 17 00:00:00 2001
2From: Changbin Du <changbin.du@gmail.com>
3Date: Tue, 28 Jan 2020 23:29:38 +0800
4Subject: [PATCH] perf: Make perf able to build with latest libbfd
5
6libbfd has changed the bfd_section_* macros to inline functions
7bfd_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
11This fix make perf able to build with both old and new libbfd.
12
13Signed-off-by: Changbin Du <changbin.du@gmail.com>
14Acked-by: Jiri Olsa <jolsa@redhat.com>
15Cc: Peter Zijlstra <peterz@infradead.org>
16Link: http://lore.kernel.org/lkml/20200128152938.31413-1-changbin.du@gmail.com
17Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
18---
19 tools/perf/util/srcline.c | 16 +++++++++++++++-
20 1 file changed, 15 insertions(+), 1 deletion(-)
21
22diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
23index af3f9b9f1e8b..b8e77617fdc4 100644
24--- a/tools/perf/util/srcline.c
25+++ b/tools/perf/util/srcline.c
26@@ -191,16 +191,30 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data)
27 bfd_vma pc, vma;
28 bfd_size_type size;
29 struct a2l_data *a2l = data;
30+ flagword flags;
31
32 if (a2l->found)
33 return;
34
35- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
36+#ifdef bfd_get_section_flags
37+ flags = bfd_get_section_flags(abfd, section);
38+#else
39+ flags = bfd_section_flags(section);
40+#endif
41+ if ((flags & SEC_ALLOC) == 0)
42 return;
43
44 pc = a2l->addr;
45+#ifdef bfd_get_section_vma
46 vma = bfd_get_section_vma(abfd, section);
47+#else
48+ vma = bfd_section_vma(section);
49+#endif
50+#ifdef bfd_get_section_size
51 size = bfd_get_section_size(section);
52+#else
53+ size = bfd_section_size(section);
54+#endif
55
56 if (pc < vma || pc >= vma + size)
57 return;
diff --git a/recipes-kernel/linux/linux-raspberrypi_4.19.bb b/recipes-kernel/linux/linux-raspberrypi_4.19.bb
index d3798b9..2cb0312 100644
--- a/recipes-kernel/linux/linux-raspberrypi_4.19.bb
+++ b/recipes-kernel/linux/linux-raspberrypi_4.19.bb
@@ -4,3 +4,5 @@ LINUX_RPI_BRANCH ?= "rpi-4.19.y"
4SRCREV = "e645cec69367ba4b6daf63933f48661ab4b59ee1" 4SRCREV = "e645cec69367ba4b6daf63933f48661ab4b59ee1"
5 5
6require linux-raspberrypi_4.19.inc 6require linux-raspberrypi_4.19.inc
7
8SRC_URI += "file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch"