summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/boost
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-10-16 11:30:22 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-20 11:11:46 +0100
commit8f03a64eddf5a81a303aa9445f876643b46a6146 (patch)
tree22ba51001e430477cb9a75660929e1152f154bc5 /meta/recipes-support/boost
parentbd56c17ba5ec344463875e2712a42fc067969ec0 (diff)
downloadpoky-8f03a64eddf5a81a303aa9445f876643b46a6146.tar.gz
boost: Fix build on 32-bit arches with 64bit time_t only
(From OE-Core rev: 7a218adf9990f5e18d0b6a33eb34091969f979c7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/boost')
-rw-r--r--meta/recipes-support/boost/boost/0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch54
-rw-r--r--meta/recipes-support/boost/boost_1.74.0.bb1
2 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-support/boost/boost/0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch b/meta/recipes-support/boost/boost/0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch
new file mode 100644
index 0000000000..523568e9bc
--- /dev/null
+++ b/meta/recipes-support/boost/boost/0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch
@@ -0,0 +1,54 @@
1From d6f7b6064dc91d1d5fa18554b40b14822ab7a32b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 16 Oct 2020 11:13:22 -0700
4Subject: [PATCH] fiber,libs: Define SYS_futex if it does not exist
5
6__NR_futex is not defines by newer architectures e.g. arc, riscv32 as
7they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on
8__NR_futex, since this is used in applications, such applications start
9to fail to build for these newer architectures. This patch defines a
10fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps
11working
12
13Upstream-Status: Pending
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 boost/fiber/detail/futex.hpp | 5 +++++
18 libs/log/src/event.cpp | 4 ++++
19 2 files changed, 9 insertions(+)
20
21diff --git a/boost/fiber/detail/futex.hpp b/boost/fiber/detail/futex.hpp
22index e64bd5990..16bee64f1 100644
23--- a/boost/fiber/detail/futex.hpp
24+++ b/boost/fiber/detail/futex.hpp
25@@ -17,6 +17,11 @@ extern "C" {
26 #include <linux/futex.h>
27 #include <sys/syscall.h>
28 }
29+
30+#if !defined(SYS_futex) && defined(SYS_futex_time64)
31+#define SYS_futex SYS_futex_time64
32+#endif
33+
34 #elif BOOST_OS_WINDOWS
35 #include <windows.h>
36 #endif
37diff --git a/libs/log/src/event.cpp b/libs/log/src/event.cpp
38index 5485154d7..2c7c0381f 100644
39--- a/libs/log/src/event.cpp
40+++ b/libs/log/src/event.cpp
41@@ -31,6 +31,10 @@
42 #include <linux/futex.h>
43 #include <boost/memory_order.hpp>
44
45+#if !defined(SYS_futex) && defined(SYS_futex_time64)
46+#define SYS_futex SYS_futex_time64
47+#endif
48+
49 // Some Android NDKs (Google NDK and older Crystax.NET NDK versions) don't define SYS_futex
50 #if defined(SYS_futex)
51 #define BOOST_LOG_SYS_FUTEX SYS_futex
52--
532.28.0
54
diff --git a/meta/recipes-support/boost/boost_1.74.0.bb b/meta/recipes-support/boost/boost_1.74.0.bb
index 5e9e0d87d7..b01b390a59 100644
--- a/meta/recipes-support/boost/boost_1.74.0.bb
+++ b/meta/recipes-support/boost/boost_1.74.0.bb
@@ -7,4 +7,5 @@ SRC_URI += "file://arm-intrinsics.patch \
7 file://0001-Apply-boost-1.62.0-no-forced-flags.patch.patch \ 7 file://0001-Apply-boost-1.62.0-no-forced-flags.patch.patch \
8 file://0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \ 8 file://0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \
9 file://0001-dont-setup-compiler-flags-m32-m64.patch \ 9 file://0001-dont-setup-compiler-flags-m32-m64.patch \
10 file://0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch \
10 " 11 "