diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-oe/recipes-devtools/flatbuffers | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-devtools/flatbuffers')
4 files changed, 206 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch new file mode 100644 index 000000000..a7a42f981 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch @@ -0,0 +1,26 @@ +From 8b44dc65d98d50b462843ac9dab6fe3fc25abe36 Mon Sep 17 00:00:00 2001 +From: Pascal Bach <pascal.bach@siemens.com> +Date: Fri, 12 May 2017 13:54:49 +0200 +Subject: [PATCH] correct version for so lib + +Upstream-Status: Pending + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3670afe..f4fcd2c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -172,6 +172,7 @@ endif() + if(FLATBUFFERS_BUILD_SHAREDLIB) + add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS}) + set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers) ++ set_target_properties(flatbuffers_shared PROPERTIES VERSION "${PV}") + endif() + + function(compile_flatbuffers_schema_to_cpp SRC_FBS) +-- +2.1.4 + diff --git a/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch new file mode 100644 index 000000000..d736f012b --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch @@ -0,0 +1,113 @@ +From a614d8e20fa9e4fd16b699d581ddac2956c120f5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Sep 2017 10:04:02 -0700 +Subject: [PATCH 1/2] flatbuffers: Move EndianSwap template to + flatbuffers/base.h + +Clang complains +call to function 'EndianSwap' that is neither visible in the template definition nor found by argument-dependent lookup + return EndianSwap(t); + +This seems to be due to limitation of two-phase lookup of dependent names in template definitions + +Its not being found using associated namespaces therefore +it has to be made visible at the template definition site as well + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + include/flatbuffers/base.h | 33 +++++++++++++++++++++++++++++++++ + include/flatbuffers/flatbuffers.h | 32 -------------------------------- + 2 files changed, 33 insertions(+), 32 deletions(-) + +diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h +index f051755..c73fb2d 100644 +--- a/include/flatbuffers/base.h ++++ b/include/flatbuffers/base.h +@@ -150,6 +150,39 @@ typedef uintmax_t largest_scalar_t; + // We support aligning the contents of buffers up to this size. + #define FLATBUFFERS_MAX_ALIGNMENT 16 + ++template<typename T> T EndianSwap(T t) { ++ #if defined(_MSC_VER) ++ #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort ++ #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong ++ #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 ++ #else ++ #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 ++ // __builtin_bswap16 was missing prior to GCC 4.8. ++ #define FLATBUFFERS_BYTESWAP16(x) \ ++ static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) ++ #else ++ #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 ++ #endif ++ #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 ++ #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 ++ #endif ++ if (sizeof(T) == 1) { // Compile-time if-then's. ++ return t; ++ } else if (sizeof(T) == 2) { ++ auto r = FLATBUFFERS_BYTESWAP16(*reinterpret_cast<uint16_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else if (sizeof(T) == 4) { ++ auto r = FLATBUFFERS_BYTESWAP32(*reinterpret_cast<uint32_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else if (sizeof(T) == 8) { ++ auto r = FLATBUFFERS_BYTESWAP64(*reinterpret_cast<uint64_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else { ++ assert(0); ++ } ++} ++ ++ + template<typename T> T EndianScalar(T t) { + #if FLATBUFFERS_LITTLEENDIAN + return t; +diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h +index 9216cf4..f749dcb 100644 +--- a/include/flatbuffers/flatbuffers.h ++++ b/include/flatbuffers/flatbuffers.h +@@ -37,38 +37,6 @@ inline void EndianCheck() { + (void)endiantest; + } + +-template<typename T> T EndianSwap(T t) { +- #if defined(_MSC_VER) +- #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort +- #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong +- #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 +- #else +- #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 +- // __builtin_bswap16 was missing prior to GCC 4.8. +- #define FLATBUFFERS_BYTESWAP16(x) \ +- static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) +- #else +- #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 +- #endif +- #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 +- #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 +- #endif +- if (sizeof(T) == 1) { // Compile-time if-then's. +- return t; +- } else if (sizeof(T) == 2) { +- auto r = FLATBUFFERS_BYTESWAP16(*reinterpret_cast<uint16_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else if (sizeof(T) == 4) { +- auto r = FLATBUFFERS_BYTESWAP32(*reinterpret_cast<uint32_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else if (sizeof(T) == 8) { +- auto r = FLATBUFFERS_BYTESWAP64(*reinterpret_cast<uint64_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else { +- assert(0); +- } +-} +- + template<typename T> FLATBUFFERS_CONSTEXPR size_t AlignOf() { + #ifdef _MSC_VER + return __alignof(T); +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch new file mode 100644 index 000000000..460159f27 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch @@ -0,0 +1,30 @@ +From 626fe5e043de25e970ebdf061b88c646fa689113 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Sep 2017 10:09:31 -0700 +Subject: [PATCH 2/2] use __builtin_bswap16 when building with clang + +clang pretends to be gcc 4.2.0 and therefore the code does +not use __builtin_bswap16 but tries to synthesize it + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + include/flatbuffers/base.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h +index c73fb2d..13e8fac 100644 +--- a/include/flatbuffers/base.h ++++ b/include/flatbuffers/base.h +@@ -156,7 +156,7 @@ template<typename T> T EndianSwap(T t) { + #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong + #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 + #else +- #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 ++ #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__) + // __builtin_bswap16 was missing prior to GCC 4.8. + #define FLATBUFFERS_BYTESWAP16(x) \ + static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb new file mode 100644 index 000000000..a8df44485 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb @@ -0,0 +1,37 @@ +SUMMARY = "Memory Efficient Serialization Library" +HOMEPAGE = "https://github.com/google/flatbuffers" +SECTION = "console/tools" +LICENSE = "Apache-2.0" + +PACKAGE_BEFORE_PN = "${PN}-compiler" + +RDEPENDS_${PN}-compiler = "${PN}" +RDEPENDS_${PN}-dev += "${PN}-compiler" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559" + +SRCREV = "25a15950f5a24d7217689739ed8f6dac64912d62" + +SRC_URI = "git://github.com/google/flatbuffers.git \ + file://0001-correct-version-for-so-lib.patch \ + file://0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch \ + file://0002-use-__builtin_bswap16-when-building-with-clang.patch \ + " + +# Make sure C++11 is used, required for example for GCC 4.9 +CXXFLAGS += "-std=c++11" +BUILD_CXXFLAGS += "-std=c++11" + +EXTRA_OECMAKE += "\ + -DFLATBUFFERS_BUILD_TESTS=OFF \ + -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ + -DPV=${PV} \ +" + +inherit cmake + +S = "${WORKDIR}/git" + +FILES_${PN}-compiler = "${bindir}" + +BBCLASSEXTEND = "native nativesdk" |