All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] tbb: Fix build with musl
@ 2021-04-13  7:24 Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2021-04-13  7:24 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Naveen Saini

Need to link libucontext on musl
Additionally, mips also needs libatomic

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Naveen Saini <naveen.kumar.saini@intel.com>
---
 meta-oe/recipes-support/tbb/tbb_2021.2.0.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb b/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb
index d0e2311402..5d11d0461c 100644
--- a/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb
+++ b/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb
@@ -6,6 +6,9 @@ DESCRIPTION = "Parallelism library for C++ - runtime files \
 HOMEPAGE = "https://software.intel.com/en-us/tbb"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327"
+
+DEPENDS_append_libc-musl = " libucontext"
+
 BRANCH = "onetbb_2021"
 SRCREV = "2dba2072869a189b9fdab3ffa431d3ea49059a19"
 SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
@@ -33,3 +36,10 @@ EXTRA_OECMAKE += " \
 # ...
 # | make[1]: *** [concurrent_queue.o] Error 1
 ARM_INSTRUCTION_SET = "arm"
+
+ASNEEDED = ""
+
+LDFLAGS_append_libc-musl_mips = " -latomic"
+LDFLAGS_append_libc-musl_mipsel = " -latomic"
+
+LDFLAGS_append_libc-musl = " -lucontext"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [meta-oe][PATCH] tbb: Fix build with musl
@ 2021-12-08 17:37 Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2021-12-08 17:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...Musl-linux-can-not-use-RTLD_DEEPBIND.patch | 33 +++++++++++++++++++
 meta-oe/recipes-support/tbb/tbb_2021.4.0.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-oe/recipes-support/tbb/tbb/0001-Musl-linux-can-not-use-RTLD_DEEPBIND.patch

diff --git a/meta-oe/recipes-support/tbb/tbb/0001-Musl-linux-can-not-use-RTLD_DEEPBIND.patch b/meta-oe/recipes-support/tbb/tbb/0001-Musl-linux-can-not-use-RTLD_DEEPBIND.patch
new file mode 100644
index 0000000000..355cf2e0bb
--- /dev/null
+++ b/meta-oe/recipes-support/tbb/tbb/0001-Musl-linux-can-not-use-RTLD_DEEPBIND.patch
@@ -0,0 +1,33 @@
+From a7289eeff4ac9e3ca2d2289672c923518433124c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 8 Dec 2021 09:26:58 -0800
+Subject: [PATCH] Musl/linux can not use RTLD_DEEPBIND
+
+Exclude non-glibc linux systems along with android
+Fixes
+src/tbb/dynamic_link.cpp:417:29: error: use
+ of undeclared identifier 'RTLD_DEEPBIND'                                                                                    |             flags = flags | RTLD_DEEPBIND;
+|                             ^
+
+Upstream-Status: Submitted [https://github.com/oneapi-src/oneTBB/pull/684]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/tbb/dynamic_link.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tbb/dynamic_link.cpp b/src/tbb/dynamic_link.cpp
+index 12f35cfd..942c1c64 100644
+--- a/src/tbb/dynamic_link.cpp
++++ b/src/tbb/dynamic_link.cpp
+@@ -413,7 +413,7 @@ namespace r1 {
+         int flags = RTLD_NOW;
+         if (local_binding) {
+             flags = flags | RTLD_LOCAL;
+-#if __linux__ && !__ANDROID__ && !__TBB_USE_SANITIZERS
++#if (__linux__ && __GLIBC__) && !__TBB_USE_SANITIZERS
+             flags = flags | RTLD_DEEPBIND;
+ #endif
+         } else {
+-- 
+2.34.1
+
diff --git a/meta-oe/recipes-support/tbb/tbb_2021.4.0.bb b/meta-oe/recipes-support/tbb/tbb_2021.4.0.bb
index 5396e1735a..e848f50779 100644
--- a/meta-oe/recipes-support/tbb/tbb_2021.4.0.bb
+++ b/meta-oe/recipes-support/tbb/tbb_2021.4.0.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH
             file://0001-mallinfo-is-glibc-specific-API-mark-it-so.patch \
             file://0001-CMakeLists.txt-exclude-riscv64-riscv32.patch \
             file://0001-Disable-use-of-_tpause-instruction.patch \
+            file://0001-Musl-linux-can-not-use-RTLD_DEEPBIND.patch \
 "
 
 S = "${WORKDIR}/git"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-08 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13  7:24 [meta-oe][PATCH] tbb: Fix build with musl Khem Raj
2021-12-08 17:37 Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.