-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This PR bumps NDK_VERSION to 21.4.7075529, and patches FileUtil.cpp from folly based on patch from facebook/folly#1593. We can remove the patch once PR lands in Folly and bump Folly version in RN. FYI, NDK 20 is deprecated and 21 is LTS release. ## Changelog [Android] [Changed] - Bump NDK to 21.4.7075529 Pull Request resolved: #31731 Reviewed By: mdvacca Differential Revision: D29166690 Pulled By: ShikaSD fbshipit-source-id: 0792691404f718aaf5af1369f66f0cba046b4e20
- Loading branch information
1 parent
512c185
commit aa43aab
Showing
5 changed files
with
39 additions
and
4 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
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
29 changes: 29 additions & 0 deletions
29
ReactAndroid/src/main/jni/third-party/folly/FileUtil.cpp.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,29 @@ | ||
--- FileUtil.cpp.orig 2021-06-16 20:53:12.000000000 +0800 | ||
+++ FileUtil.cpp 2021-06-16 20:53:37.000000000 +0800 | ||
@@ -35,7 +35,26 @@ | ||
using namespace fileutil_detail; | ||
|
||
int openNoInt(const char* name, int flags, mode_t mode) { | ||
+#if defined(__ANDROID__) | ||
+ // NDK bionic with FORTIFY has this definition: | ||
+ // https://android.googlesource.com/platform/bionic/+/9349b9e51b/libc/include/bits/fortify/fcntl.h | ||
+ // ``` | ||
+ // __BIONIC_ERROR_FUNCTION_VISIBILITY | ||
+ // int open(const char* pathname, int flags, mode_t modes, ...) __overloadable | ||
+ // __errorattr(__open_too_many_args_error); | ||
+ // ``` | ||
+ // This is originally to prevent open() with incorrect parameters. | ||
+ // | ||
+ // However, combined with folly wrapNotInt, template deduction will fail. | ||
+ // In this case, we create a custom Open lambda to bypass the error. | ||
+ // The solution is referenced from | ||
+ // https://github.com/llvm/llvm-project/commit/0a0e411204a2baa520fd73a8d69b664f98b428ba | ||
+ // | ||
+ auto Open = [&]() { return open(name, flags, mode); }; | ||
+ return int(wrapNoInt(Open)); | ||
+#else | ||
return int(wrapNoInt(open, name, flags, mode)); | ||
+#endif | ||
} | ||
|
||
static int filterCloseReturn(int r) { |
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
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