summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-02-12 12:25:59 -0800
committerKhem Raj <raj.khem@gmail.com>2019-02-13 09:27:22 -0800
commite4c5c0da6bf3f0d8a171e8361e83c49760108277 (patch)
tree69aa7599582815fb5942f4cac237687b886c5f03 /meta-oe/recipes-kernel
parentcfdc6c721c465c6ad111a401e2c3a2445f701a94 (diff)
downloadmeta-openembedded-e4c5c0da6bf3f0d8a171e8361e83c49760108277.tar.gz
oprofile: Fix build with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile.inc1
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch131
2 files changed, 132 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile.inc b/meta-oe/recipes-kernel/oprofile/oprofile.inc
index 349e2bf54..515ea8faf 100644
--- a/meta-oe/recipes-kernel/oprofile/oprofile.inc
+++ b/meta-oe/recipes-kernel/oprofile/oprofile.inc
@@ -25,6 +25,7 @@ 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 file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ 27 file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \
28 file://0001-replace-sym_iterator-0-with-sym_iterator.patch \
28" 29"
29UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" 30UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/"
30UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" 31UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/"
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch
new file mode 100644
index 000000000..5fd23f809
--- /dev/null
+++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch
@@ -0,0 +1,131 @@
1From b7c1a2e2b0f4657fe291324ca409224f3321c9ff Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 12 Feb 2019 11:58:34 -0800
4Subject: [PATCH] replace (sym_iterator)0 with sym_iterator()
5
6clang/libc++ find this error
7
8libpp/xml_utils.cpp:409:43: error: calling a private constructor of class 'std::__1::__wrap_iter<const sym
9bol_entry *const *>'
10| { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;}
11| ^
12|
13
14default constructed iterator isn't supposed to be used for anything
15
16Upstream-Status: Pending
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 libpp/xml_utils.cpp | 26 +++++++++++++-------------
20 1 file changed, 13 insertions(+), 13 deletions(-)
21
22diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp
23index 3de41e5..f45d3ae 100644
24--- a/libpp/xml_utils.cpp
25+++ b/libpp/xml_utils.cpp
26@@ -73,7 +73,7 @@ void dump_symbol(string const & prefix, sym_iterator it, bool want_nl = true)
27
28 void dump_symbols(string const & prefix, sym_iterator b, sym_iterator e)
29 {
30- if (b == (sym_iterator)0)
31+ if (b == sym_iterator())
32 return;
33
34 for (sym_iterator it = b; it != e; ++it)
35@@ -167,7 +167,7 @@ string xml_utils::get_profile_header(string cpu_name, double const speed)
36 }
37
38 str << init_attr(CPU_NAME, cpu_type) << endl;
39- if (processor.size() > 0)
40+ if (processor.size() > 0)
41 str << init_attr(PROCESSOR, string(processor)) << endl;
42 if (nr_cpus > 1) str << init_attr(SEPARATED_CPUS, nr_cpus) << endl;
43 str << init_attr(MHZ, speed) << endl;
44@@ -320,11 +320,11 @@ void xml_utils::build_subclasses(ostream & out)
45 (*sc_ptr)[new_index].subclass_name = subclass_name;
46 out << open_element(CLASS, true);
47 out << init_attr(NAME, subclass_name);
48- if (nr_cpus > 1)
49+ if (nr_cpus > 1)
50 out << init_attr(CPU_NUM, pclass.ptemplate.cpu);
51- if (nr_events > 1)
52+ if (nr_events > 1)
53 out << init_attr(EVENT_NUM, event);
54- if (has_nonzero_masks)
55+ if (has_nonzero_masks)
56 out << init_attr(EVENT_MASK, pclass.ptemplate.unitmask);
57 out << close_element();
58 }
59@@ -406,7 +406,7 @@ xml_utils::output_summary_data(ostream & out, count_array_t const & summary, siz
60 class module_info {
61 public:
62 module_info()
63- { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;}
64+ { lo = hi = 0; name = ""; begin = end = sym_iterator();}
65 void dump();
66 void build_module(string const & n, sym_iterator it,
67 size_t l, size_t h);
68@@ -540,21 +540,21 @@ void module_info::add_to_summary(count_array_t const & counts)
69
70 void module_info::set_begin(sym_iterator b)
71 {
72- if (begin == (sym_iterator)0)
73+ if (begin == sym_iterator())
74 begin = b;
75 }
76
77
78 void module_info::set_end(sym_iterator e)
79 {
80- if (end == (sym_iterator)0)
81+ if (end == sym_iterator())
82 end = e;
83 }
84
85
86 bool module_info::is_closed(string const & n)
87 {
88- return (name == n) && end != (sym_iterator)0;
89+ return (name == n) && end != sym_iterator();
90 }
91
92
93@@ -585,7 +585,7 @@ void module_info::output_summary(ostream & out)
94
95 void module_info::output_symbols(ostream & out, bool is_module)
96 {
97- if (begin == (sym_iterator)0)
98+ if (begin == sym_iterator())
99 return;
100
101 for (sym_iterator it = begin; it != end; ++it)
102@@ -606,7 +606,7 @@ void binary_info::close_binary(sym_iterator it)
103 void binary_info::dump()
104 {
105 cverb << vxml << "app_name=" << name << endl;
106- if (begin != (sym_iterator)0)
107+ if (begin != sym_iterator())
108 dump_symbols(" ", begin, end);
109
110 for (size_t i = 0; i < nr_modules; ++i)
111@@ -648,7 +648,7 @@ add_module_symbol(string const & module, string const & app,
112 // mark end of enclosing binary symbols if there have been any
113 // NOTE: it is possible for the binary's symbols to follow its
114 // module symbols
115- if (begin != (sym_iterator)0 && end == (sym_iterator)0)
116+ if (begin != sym_iterator() && end == sym_iterator())
117 set_end(it);
118
119 // build the new module
120@@ -718,7 +718,7 @@ summarize_processes(extra_images const & extra_found_images)
121 {
122 // add modules to the appropriate threads in the process hierarchy
123 for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) {
124- string binary = get_image_name((*it)->app_name,
125+ string binary = get_image_name((*it)->app_name,
126 image_name_storage::int_filename, extra_found_images);
127 string module = get_image_name((*it)->image_name,
128 image_name_storage::int_filename, extra_found_images);
129--
1302.20.1
131