summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Saini <naveen.kumar.saini@intel.com>2019-06-13 07:36:38 (GMT)
committerAnuj Mittal <anuj.mittal@intel.com>2019-06-13 08:11:25 (GMT)
commita7748e0cadf67918aee1f4910e2763de43284356 (patch)
treeb74f2b44e9fe1775ced5db30a379a4a04915194f
parentc941d896c08d6d83694ba0af1fdf4f4dcb625e9f (diff)
downloadmeta-intel-a7748e0cadf67918aee1f4910e2763de43284356.tar.gz
libyami: fix build error with gcc9
GCC9 causing multiple build failures: | ../../git/codecparsers/h264Parser.cpp: In constructor 'YamiParser::H264::PPS::PPS()': | ../../git/codecparsers/h264Parser.cpp:140:41: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H264::PPS' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] | 140 | memset(this, 0, offsetof(PPS, m_sps)); ... Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--recipes-multimedia/libyami/libyami/0010-h26xparser-Fix-build-error-with-GCC9.patch157
-rw-r--r--recipes-multimedia/libyami/libyami_1.3.1.bb1
2 files changed, 158 insertions, 0 deletions
diff --git a/recipes-multimedia/libyami/libyami/0010-h26xparser-Fix-build-error-with-GCC9.patch b/recipes-multimedia/libyami/libyami/0010-h26xparser-Fix-build-error-with-GCC9.patch
new file mode 100644
index 0000000..be69ab7
--- /dev/null
+++ b/recipes-multimedia/libyami/libyami/0010-h26xparser-Fix-build-error-with-GCC9.patch
@@ -0,0 +1,157 @@
1From fdb8185749098eaf55050c4ec5c0f21c5be1e326 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Tue, 4 Jun 2019 16:53:16 +0800
4Subject: [PATCH] h26xparser: Fix build error with GCC9
5
6GCC9 causing build failure:
7
8| ../../git/codecparsers/h264Parser.cpp: In constructor 'YamiParser::H264::PPS::PPS()':
9| ../../git/codecparsers/h264Parser.cpp:140:41: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H264::PPS' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
10| 140 | memset(this, 0, offsetof(PPS, m_sps));
11| | ^
12| In file included from ../../git/codecparsers/h264Parser.cpp:21:
13| ../../git/codecparsers/h264Parser.h:292:8: note: 'struct YamiParser::H264::PPS' declared here
14| 292 | struct PPS {
15| | ^~~
16| ../../git/codecparsers/h264Parser.cpp: In constructor 'YamiParser::H264::SliceHeader::SliceHeader()':
17| ../../git/codecparsers/h264Parser.cpp:686:49: error: 'void* memset(void*, int, size_t)' clearing an object of type 'class YamiParser::H264::SliceHeader' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
18| 686 | memset(this, 0, offsetof(SliceHeader, m_pps));
19| | ^
20| In file included from ../../git/codecparsers/h264Parser.cpp:21:
21| ../../git/codecparsers/h264Parser.h:371:7: note: 'class YamiParser::H264::SliceHeader' declared here
22| 371 | class SliceHeader {
23| | ^~~~~~~~~~~
24| ../../git/codecparsers/h265Parser.cpp: In constructor 'YamiParser::H265::VPS::VPS()':
25| ../../git/codecparsers/h265Parser.cpp:165:53: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H265::VPS' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
26| 165 | memset(this, 0, offsetof(VPS, hrd_layer_set_idx));
27| | ^
28| In file included from ../../git/codecparsers/h265Parser.cpp:21:
29| ../../git/codecparsers/h265Parser.h:256:12: note: 'struct YamiParser::H265::VPS' declared here
30| 256 | struct VPS {
31| | ^~~
32| ../../git/codecparsers/h265Parser.cpp: In constructor 'YamiParser::H265::SPS::SPS()':
33| ../../git/codecparsers/h265Parser.cpp:174:39: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H265::SPS' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
34| 174 | memset(this, 0, offsetof(SPS, vps));
35| | ^
36| In file included from ../../git/codecparsers/h265Parser.cpp:21:
37| ../../git/codecparsers/h265Parser.h:290:12: note: 'struct YamiParser::H265::SPS' declared here
38| 290 | struct SPS {
39| | ^~~
40| ../../git/codecparsers/h265Parser.cpp: In constructor 'YamiParser::H265::PPS::PPS()':
41| ../../git/codecparsers/h265Parser.cpp:179:39: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H265::PPS' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
42| 179 | memset(this, 0, offsetof(PPS, sps));
43| | ^
44| In file included from ../../git/codecparsers/h265Parser.cpp:21:
45| ../../git/codecparsers/h265Parser.h:362:12: note: 'struct YamiParser::H265::PPS' declared here
46| 362 | struct PPS {
47| | ^~~
48| ../../git/codecparsers/h265Parser.cpp: In constructor 'YamiParser::H265::SliceHeader::SliceHeader()':
49| ../../git/codecparsers/h265Parser.cpp:184:47: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct YamiParser::H265::SliceHeader' with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
50| 184 | memset(this, 0, offsetof(SliceHeader, pps));
51| | ^
52| In file included from ../../git/codecparsers/h265Parser.cpp:21:
53| ../../git/codecparsers/h265Parser.h:499:12: note: 'struct YamiParser::H265::SliceHeader' declared here
54| 499 | struct SliceHeader {
55| | ^~~~~~~~~~~
56| ../../git/codecparsers/mpeg2_parser.cpp: In constructor 'YamiParser::MPEG2::SeqHeader::SeqHeader()':
57| ../../git/codecparsers/mpeg2_parser.cpp:163:59: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct YamiParser::MPEG2::SeqHeader'; use assignment or value-initialization instead [-Werror=class-memaccess]
58| 163 | SeqHeader::SeqHeader() { memset(this, 0, sizeof(*this)); }
59| | ^
60| In file included from ../../git/codecparsers/mpeg2_parser.cpp:34:
61| ../../git/codecparsers/mpeg2_parser.h:153:12: note: 'struct YamiParser::MPEG2::SeqHeader' declared here
62| 153 | struct SeqHeader {
63| | ^~~~~~~~~
64| cc1plus: all warnings being treated as errors
65
66By typecasting structure pointer to void pointer, GCC9 does normal memset operation where offsetof() give correct
67number of bytes to set.
68
69Status: Submitted [https://github.com/intel/libyami/pull/876]
70
71Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
72---
73 codecparsers/h264Parser.cpp | 4 ++--
74 codecparsers/h265Parser.cpp | 8 ++++----
75 codecparsers/mpeg2_parser.cpp | 3 ++-
76 3 files changed, 8 insertions(+), 7 deletions(-)
77
78diff --git a/codecparsers/h264Parser.cpp b/codecparsers/h264Parser.cpp
79index 22117a1..6f7959e 100644
80--- a/codecparsers/h264Parser.cpp
81+++ b/codecparsers/h264Parser.cpp
82@@ -137,7 +137,7 @@ static bool scalingList(NalReader& br, uint8_t* sl, uint32_t size, uint32_t inde
83
84 PPS::PPS()
85 {
86- memset(this, 0, offsetof(PPS, m_sps));
87+ memset((void*)this, 0, offsetof(PPS, m_sps));
88 }
89
90 PPS::~PPS()
91@@ -683,7 +683,7 @@ Parser::searchSps(uint8_t id) const
92
93 SliceHeader::SliceHeader()
94 {
95- memset(this, 0, offsetof(SliceHeader, m_pps));
96+ memset((void*)this, 0, offsetof(SliceHeader, m_pps));
97 }
98
99 bool SliceHeader::refPicListModification(NalReader& br, RefPicListModification* pm0,
100diff --git a/codecparsers/h265Parser.cpp b/codecparsers/h265Parser.cpp
101index 0dea3a6..d7e6740 100644
102--- a/codecparsers/h265Parser.cpp
103+++ b/codecparsers/h265Parser.cpp
104@@ -162,7 +162,7 @@ static const uint8_t DefaultScalingList2[64] = {
105
106 VPS::VPS()
107 {
108- memset(this, 0, offsetof(VPS, hrd_layer_set_idx));
109+ memset((void*)this, 0, offsetof(VPS, hrd_layer_set_idx));
110 }
111
112 VPS::~VPS()
113@@ -171,17 +171,17 @@ VPS::~VPS()
114
115 SPS::SPS()
116 {
117- memset(this, 0, offsetof(SPS, vps));
118+ memset((void*)this, 0, offsetof(SPS, vps));
119 }
120
121 PPS::PPS()
122 {
123- memset(this, 0, offsetof(PPS, sps));
124+ memset((void*)this, 0, offsetof(PPS, sps));
125 }
126
127 SliceHeader::SliceHeader()
128 {
129- memset(this, 0, offsetof(SliceHeader, pps));
130+ memset((void*)this, 0, offsetof(SliceHeader, pps));
131 }
132
133 SliceHeader::~SliceHeader()
134diff --git a/codecparsers/mpeg2_parser.cpp b/codecparsers/mpeg2_parser.cpp
135index 21032b1..173da39 100644
136--- a/codecparsers/mpeg2_parser.cpp
137+++ b/codecparsers/mpeg2_parser.cpp
138@@ -33,6 +33,7 @@
139 #include "common/log.h"
140 #include "mpeg2_parser.h"
141 #include <inttypes.h>
142+#include <cstddef>
143
144 namespace YamiParser {
145 namespace MPEG2 {
146@@ -160,7 +161,7 @@ namespace MPEG2 {
147
148 SeqExtension::SeqExtension() { memset(this, 0, sizeof(*this)); }
149
150- SeqHeader::SeqHeader() { memset(this, 0, sizeof(*this)); }
151+ SeqHeader::SeqHeader() { memset((void*)this, 0, offsetof(SeqHeader, quantizationMatrices)); }
152
153 StreamHeader::StreamHeader() { memset(this, 0, sizeof(*this)); }
154
155--
1562.17.0
157
diff --git a/recipes-multimedia/libyami/libyami_1.3.1.bb b/recipes-multimedia/libyami/libyami_1.3.1.bb
index 58895c8..8384593 100644
--- a/recipes-multimedia/libyami/libyami_1.3.1.bb
+++ b/recipes-multimedia/libyami/libyami_1.3.1.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/intel/libyami.git;branch=apache \
17 file://0007-Delete-unused-variables.patch \ 17 file://0007-Delete-unused-variables.patch \
18 file://0008-NalUnit-is-declared-in-different-namespace.patch \ 18 file://0008-NalUnit-is-declared-in-different-namespace.patch \
19 file://0009-Fix-clang-warnings.patch \ 19 file://0009-Fix-clang-warnings.patch \
20 file://0010-h26xparser-Fix-build-error-with-GCC9.patch \
20" 21"
21SRCREV = "fb48083de91f837ddbf599dd4b5ad1eb1239e1cf" 22SRCREV = "fb48083de91f837ddbf599dd4b5ad1eb1239e1cf"
22S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"