forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-cpp/tbb: fix underlinking on musl
Avoid *context APIs. In theory, may not be needed (shouldn't be) given we've fixed our packaging of libucontext, but let's do this anyway as the fix is upstream, and it avoids possible otehr issues. Bug: rui314/mold#281 Closes: https://bugs.gentoo.org/832700 Signed-off-by: Sam James <[email protected]>
- Loading branch information
1 parent
1d87183
commit d4d7c55
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
https://bugs.gentoo.org/832700 | ||
https://github.com/oneapi-src/oneTBB/commit/6a15b64093c51ddc00bdf4a6b49d4bbec1574a12 | ||
|
||
From: Rui Ueyama <[email protected]> | ||
Date: Fri, 4 Feb 2022 19:32:11 +0900 | ||
Subject: [PATCH] Make tbb compile with musl libc (#748) | ||
|
||
TBB resumable tasks are implemented using getcontext() and setcontext() | ||
on Unix-like systems. These functions are deprecated in the recent | ||
versions of POSIX and may not exist. musl libc does not provide these | ||
functions. | ||
|
||
There's unfortunately no way to detect musl (musl intentionally do not | ||
define macros like `__MUSL__`), so __TBB_RESUMABLE_TASKS is defined if | ||
`__GLIBC__`. glibc-compatible libc's such as uClibc defines `__GLIBC__`, | ||
so it should work as a catch-all condition. | ||
|
||
Signed-off-by: Rui Ueyama <[email protected]> | ||
--- a/include/oneapi/tbb/detail/_config.h | ||
+++ b/include/oneapi/tbb/detail/_config.h | ||
@@ -268,7 +268,7 @@ | ||
#define __TBB_CPP20_COMPARISONS_PRESENT __TBB_CPP20_PRESENT | ||
#endif | ||
|
||
-#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__) | ||
+#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__)) | ||
|
||
/* This macro marks incomplete code or comments describing ideas which are considered for the future. | ||
* See also for plain comment with TODO and FIXME marks for small improvement opportunities. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters