1 |
commit: d4d7c559ae6598261d115f4db6b955d50c4a184c |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 7 04:00:01 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 7 04:01:01 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4d7c559 |
7 |
|
8 |
dev-cpp/tbb: fix underlinking on musl |
9 |
|
10 |
Avoid *context APIs. |
11 |
|
12 |
In theory, may not be needed (shouldn't be) given we've fixed our packaging |
13 |
of libucontext, but let's do this anyway as the fix is upstream, and it |
14 |
avoids possible otehr issues. |
15 |
|
16 |
Bug: https://github.com/rui314/mold/issues/281 |
17 |
Closes: https://bugs.gentoo.org/832700 |
18 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
19 |
|
20 |
.../tbb/files/tbb-2021.5.0-musl-setcontext.patch | 30 ++++++++++++++++++++++ |
21 |
...{tbb-2021.5.0.ebuild => tbb-2021.5.0-r1.ebuild} | 2 ++ |
22 |
2 files changed, 32 insertions(+) |
23 |
|
24 |
diff --git a/dev-cpp/tbb/files/tbb-2021.5.0-musl-setcontext.patch b/dev-cpp/tbb/files/tbb-2021.5.0-musl-setcontext.patch |
25 |
new file mode 100644 |
26 |
index 000000000000..111bbf123d9a |
27 |
--- /dev/null |
28 |
+++ b/dev-cpp/tbb/files/tbb-2021.5.0-musl-setcontext.patch |
29 |
@@ -0,0 +1,30 @@ |
30 |
+https://bugs.gentoo.org/832700 |
31 |
+https://github.com/oneapi-src/oneTBB/commit/6a15b64093c51ddc00bdf4a6b49d4bbec1574a12 |
32 |
+ |
33 |
+From: Rui Ueyama <rui314@×××××.com> |
34 |
+Date: Fri, 4 Feb 2022 19:32:11 +0900 |
35 |
+Subject: [PATCH] Make tbb compile with musl libc (#748) |
36 |
+ |
37 |
+TBB resumable tasks are implemented using getcontext() and setcontext() |
38 |
+on Unix-like systems. These functions are deprecated in the recent |
39 |
+versions of POSIX and may not exist. musl libc does not provide these |
40 |
+functions. |
41 |
+ |
42 |
+There's unfortunately no way to detect musl (musl intentionally do not |
43 |
+define macros like `__MUSL__`), so __TBB_RESUMABLE_TASKS is defined if |
44 |
+`__GLIBC__`. glibc-compatible libc's such as uClibc defines `__GLIBC__`, |
45 |
+so it should work as a catch-all condition. |
46 |
+ |
47 |
+Signed-off-by: Rui Ueyama <ruiu@×××××××××××.edu> |
48 |
+--- a/include/oneapi/tbb/detail/_config.h |
49 |
++++ b/include/oneapi/tbb/detail/_config.h |
50 |
+@@ -268,7 +268,7 @@ |
51 |
+ #define __TBB_CPP20_COMPARISONS_PRESENT __TBB_CPP20_PRESENT |
52 |
+ #endif |
53 |
+ |
54 |
+-#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__) |
55 |
++#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__)) |
56 |
+ |
57 |
+ /* This macro marks incomplete code or comments describing ideas which are considered for the future. |
58 |
+ * See also for plain comment with TODO and FIXME marks for small improvement opportunities. |
59 |
+ |
60 |
|
61 |
diff --git a/dev-cpp/tbb/tbb-2021.5.0.ebuild b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild |
62 |
similarity index 93% |
63 |
rename from dev-cpp/tbb/tbb-2021.5.0.ebuild |
64 |
rename to dev-cpp/tbb/tbb-2021.5.0-r1.ebuild |
65 |
index 6b2ff50c7c4a..22d714102105 100644 |
66 |
--- a/dev-cpp/tbb/tbb-2021.5.0.ebuild |
67 |
+++ b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild |
68 |
@@ -30,6 +30,8 @@ PATCHES=( |
69 |
"${FILESDIR}"/${PN}-2021.4.0-missing-TBB_machine_fetchadd4.patch |
70 |
# need to verify this is in master |
71 |
"${FILESDIR}"/${PN}-2021.5.0-musl-mallinfo.patch |
72 |
+ # musl again, should be in.. 2022? |
73 |
+ "${FILESDIR}"/${PN}-2021.5.0-musl-setcontext.patch |
74 |
) |
75 |
|
76 |
src_configure() { |