From dc623bac0bfbdf374c5417c4eba7ff01918fd625 Mon Sep 17 00:00:00 2001 From: Sai Hari Chandana Kalluri Date: Thu, 29 Oct 2020 15:39:57 -0700 Subject: xrt_git.bb: Replace deprecated boost macros xrt source includes boost/detail/endian.hpp to detect endianess. In Yocto, gatesgarth, boost version is 1.74 which has deprecated some older macros resulting in the below error /workspaces/ckalluri/yocto/master-dev/builds-versal/tmp/work/cortexa72-cortexa53-xilinx-linux/xrt/202010.2.7.0-r0/git/src/runtime_src/xocl/core/kernel.cpp:24:10: fatal error: boost/detail/e ndian.hpp: No such file or directory | 24 | | compilation terminated. To fix the compilation issue, currently include a patch on top of xrt source that replaces the deprecated BOOST_BYTE_ORDER macro with __BYTE_ORDER macro to detect endianess. Signed-off-by: Sai Hari Chandana Kalluri --- ...st-detail-endian.hpp-with-boost-predef-ot.patch | 80 ++++++++++++++++++++++ meta-xilinx-bsp/recipes-xrt/xrt/xrt_git.bb | 2 + 2 files changed, 82 insertions(+) create mode 100644 meta-xilinx-bsp/recipes-xrt/xrt/xrt/0001-Replace-boost-detail-endian.hpp-with-boost-predef-ot.patch (limited to 'meta-xilinx-bsp') diff --git a/meta-xilinx-bsp/recipes-xrt/xrt/xrt/0001-Replace-boost-detail-endian.hpp-with-boost-predef-ot.patch b/meta-xilinx-bsp/recipes-xrt/xrt/xrt/0001-Replace-boost-detail-endian.hpp-with-boost-predef-ot.patch new file mode 100644 index 00000000..2ad7f01a --- /dev/null +++ b/meta-xilinx-bsp/recipes-xrt/xrt/xrt/0001-Replace-boost-detail-endian.hpp-with-boost-predef-ot.patch @@ -0,0 +1,80 @@ +From aa556b2142b8d6c62c457f82f4470430e9fe80e7 Mon Sep 17 00:00:00 2001 +From: Sai Hari Chandana Kalluri +Date: Thu, 29 Oct 2020 15:28:06 -0700 +Subject: [PATCH] Replace boost/detail/endian.hpp with + boost/predef/other/endian.h + +The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Include + and use __BYTE_ORDER and1234 + +Signed-off-by: Sai Hari Chandana Kalluri +--- + runtime_src/core/common/api/xrt_kernel.cpp | 8 ++++---- + runtime_src/xocl/core/kernel.cpp | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/runtime_src/core/common/api/xrt_kernel.cpp b/runtime_src/core/common/api/xrt_kernel.cpp +index 1025e9d..1fb7caf 100644 +--- a/runtime_src/core/common/api/xrt_kernel.cpp ++++ b/runtime_src/core/common/api/xrt_kernel.cpp +@@ -48,7 +48,7 @@ + #include + using namespace std::chrono_literals; + +-#include ++#include + + #ifdef _WIN32 + # pragma warning( disable : 4244 4267 4996) +@@ -464,7 +464,7 @@ class argument + virtual std::vector + get_value(std::va_list* args) const + { +- static_assert(BOOST_BYTE_ORDER==1234,"Big endian detected"); ++ static_assert(__BYTE_ORDER==1234,"Big endian detected"); + + HostType value = va_arg(*args, VaArgType); + return value_to_uint32_vector(value); +@@ -485,7 +485,7 @@ class argument + virtual std::vector + get_value(std::va_list* args) const + { +- static_assert(BOOST_BYTE_ORDER==1234,"Big endian detected"); ++ static_assert(__BYTE_ORDER==1234,"Big endian detected"); + + HostType* value = va_arg(*args, VaArgType*); + return value_to_uint32_vector(value, size); +@@ -507,7 +507,7 @@ class argument + virtual std::vector + get_value(std::va_list* args) const + { +- static_assert(BOOST_BYTE_ORDER==1234,"Big endian detected"); ++ static_assert(__BYTE_ORDER==1234,"Big endian detected"); + if (xrt_core::config::get_xrt_bo()) { + auto bo = va_arg(*args, xrtBufferHandle); + return value_to_uint32_vector(xrt_core::bo::address(bo)); +diff --git a/runtime_src/xocl/core/kernel.cpp b/runtime_src/xocl/core/kernel.cpp +index f4f7edf..ec71c7e 100644 +--- a/runtime_src/xocl/core/kernel.cpp ++++ b/runtime_src/xocl/core/kernel.cpp +@@ -21,7 +21,7 @@ + #include "compute_unit.h" + #include "core/common/xclbin_parser.h" + +-#include ++#include + + #include + #include +@@ -130,7 +130,7 @@ void + kernel::scalar_argument:: + set(size_t size, const void* cvalue) + { +- static_assert(BOOST_BYTE_ORDER==1234,"Big endian detected"); ++ static_assert(__BYTE_ORDER==1234,"Big endian detected"); + + if (size != m_sz) + throw error(CL_INVALID_ARG_SIZE,"Invalid scalar argument size, expected " +-- +2.7.4 + diff --git a/meta-xilinx-bsp/recipes-xrt/xrt/xrt_git.bb b/meta-xilinx-bsp/recipes-xrt/xrt/xrt_git.bb index e522d387..d891c272 100644 --- a/meta-xilinx-bsp/recipes-xrt/xrt/xrt_git.bb +++ b/meta-xilinx-bsp/recipes-xrt/xrt/xrt_git.bb @@ -14,6 +14,8 @@ REPO ?= "git://github.com/Xilinx/XRT.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" +FILESEXTRAPATHS_prepend := "${THISDIR}/xrt:" +SRC_URI_append = " file://0001-Replace-boost-detail-endian.hpp-with-boost-predef-ot.patch" PV = "202010.2.7.0" SRCREV ?= "8a4c6eb5012c57423fba468e1af8df53a293dcd5" -- cgit v1.2.3-54-g00ecf