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-util/bazel: add upstream musl patch
Closes: https://bugs.gentoo.org/815907 Signed-off-by: Sam James <[email protected]>
- Loading branch information
1 parent
e4c0465
commit ac00d0d
Showing
2 changed files
with
35 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
34 changes: 34 additions & 0 deletions
34
dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch
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,34 @@ | ||
https://bugs.gentoo.org/815907 | ||
https://github.com/bazelbuild/bazel/commit/bcce6dd026e90336e80616a8c1004a79a2f8640c | ||
|
||
From: philwo <[email protected]> | ||
Date: Thu, 20 May 2021 08:13:09 -0700 | ||
Subject: [PATCH] Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc. | ||
|
||
This allows us to build Bazel on Linux systems which use a C standard library that does not include this macro, like Alpine Linux (which uses musl). | ||
|
||
Fixes #12460. | ||
|
||
PiperOrigin-RevId: 374873483 | ||
--- a/src/main/tools/linux-sandbox-pid1.cc | ||
+++ b/src/main/tools/linux-sandbox-pid1.cc | ||
@@ -49,6 +49,19 @@ | ||
#include <linux/fs.h> | ||
#endif | ||
|
||
+#ifndef TEMP_FAILURE_RETRY | ||
+// Some C standard libraries like musl do not define this macro, so we'll | ||
+// include our own version for compatibility. | ||
+#define TEMP_FAILURE_RETRY(exp) \ | ||
+ ({ \ | ||
+ decltype(exp) _rc; \ | ||
+ do { \ | ||
+ _rc = (exp); \ | ||
+ } while (_rc == -1 && errno == EINTR); \ | ||
+ _rc; \ | ||
+ }) | ||
+#endif // TEMP_FAILURE_RETRY | ||
+ | ||
#include "src/main/tools/linux-sandbox-options.h" | ||
#include "src/main/tools/linux-sandbox.h" | ||
#include "src/main/tools/logging.h" |