aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrimoz Fiser <primoz.fiser@norik.com>2018-11-23 15:48:43 +0100
committerArmin Kuster <akuster808@gmail.com>2019-02-04 21:09:37 -0800
commit1c982f813dca2c271b82c7a92c0c8c92d62a800b (patch)
tree466842c468f0e70e7e04b6b7740369c9a13791ed
parentd7306703f66bb87da37a0d201d4d451dfa84e371 (diff)
downloadmeta-openembedded-1c982f813dca2c271b82c7a92c0c8c92d62a800b.tar.gz
meta-openembedded-1c982f813dca2c271b82c7a92c0c8c92d62a800b.tar.bz2
meta-openembedded-1c982f813dca2c271b82c7a92c0c8c92d62a800b.zip
sedutil: fix compile errors on big endian architectures
Patch fixes compile errors by defining empty macros as hinted by TODO mark in the sources. Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-extended/sedutil/files/0001-Fix-build-on-big-endian-architectures.patch41
-rw-r--r--meta-oe/recipes-extended/sedutil/sedutil_git.bb4
2 files changed, 44 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/sedutil/files/0001-Fix-build-on-big-endian-architectures.patch b/meta-oe/recipes-extended/sedutil/files/0001-Fix-build-on-big-endian-architectures.patch
new file mode 100644
index 000000000..7351197e4
--- /dev/null
+++ b/meta-oe/recipes-extended/sedutil/files/0001-Fix-build-on-big-endian-architectures.patch
@@ -0,0 +1,41 @@
+From ff98a326d5faa585f0e15e51a558cc2c49aa8099 Mon Sep 17 00:00:00 2001
+From: Primoz Fiser <primoz.fiser@norik.com>
+Date: Fri, 23 Nov 2018 08:31:29 +0100
+Subject: [PATCH] Fix build on big endian architectures
+
+Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
+---
+ Common/DtaEndianFixup.h | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/Common/DtaEndianFixup.h b/Common/DtaEndianFixup.h
+index 58eb3ff..184fce0 100644
+--- a/Common/DtaEndianFixup.h
++++ b/Common/DtaEndianFixup.h
+@@ -31,12 +31,11 @@ along with sedutil. If not, see <http://www.gnu.org/licenses/>.
+ //TODO: add a test on the endianess of the system and define
+ // empty macros if the system is big endian
+ #pragma once
+-#ifdef __gnu_linux__
+-#include <endian.h>
+-#if __BYTE_ORDER != __LITTLE_ENDIAN
+-#error This code does not support big endian architectures
+-#endif
+-#endif
++#if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
++#define SWAP16(x) x
++#define SWAP32(x) x
++#define SWAP64(x) x
++#else
+ /** change the "endianess" of a 16bit field */
+ #define SWAP16(x) ((uint16_t) ((x & 0x00ff) << 8) | ((x & 0xff00) >> 8))
+ /** change the "endianess" of a 32bit field */
+@@ -47,3 +46,5 @@ along with sedutil. If not, see <http://www.gnu.org/licenses/>.
+ ((uint64_t) (SWAP32((x & 0x00000000ffffffff)) << 32) | \
+ ((uint64_t) (SWAP32((x >> 32))) ) \
+ )
++
++#endif
+--
+2.7.4
+
diff --git a/meta-oe/recipes-extended/sedutil/sedutil_git.bb b/meta-oe/recipes-extended/sedutil/sedutil_git.bb
index cec569f62..765618433 100644
--- a/meta-oe/recipes-extended/sedutil/sedutil_git.bb
+++ b/meta-oe/recipes-extended/sedutil/sedutil_git.bb
@@ -10,7 +10,9 @@ LIC_FILES_CHKSUM = "file://Common/LICENSE.txt;md5=d32239bcb673463ab874e80d47fae5
BASEPV = "1.15.1"
PV = "${BASEPV}+git${SRCPV}"
SRCREV = "358cc758948be788284d5faba46ccf4cc1813796"
-SRC_URI = "git://github.com/Drive-Trust-Alliance/sedutil.git"
+SRC_URI = "git://github.com/Drive-Trust-Alliance/sedutil.git \
+ file://0001-Fix-build-on-big-endian-architectures.patch \
+"
S = "${WORKDIR}/git"