commit | 4f5893e1ec3eace31ee790bf66797d3bf622eebb | [log] [tgz] |
---|---|---|
author | Emilio Cota <ecg@google.com> | Wed Apr 20 11:57:40 2022 -0400 |
committer | Emilio Cota <ecg@google.com> | Wed Apr 20 12:12:02 2022 -0400 |
tree | 569e662030ecd0fd9f80382788e66da8a5cbb364 | |
parent | 684d69db03de24604b8cf83ad2e0e62c2dc80798 [diff] |
memfd_create: disable for ANDROID_API < 30 The syscall is wrapped in Bionic from API version 30: https://android.googlesource.com/platform/bionic.git/+/3d24d2b0883e%5E!/ This fixes the build for earlier versions of Android. Note that MDF_CLOEXEC as well as the raw syscall numbers for memfd_create were added much earlier: https://android.googlesource.com/platform/bionic.git/+/82d7504cd7d5%5E!/
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 3e8e258..9bc12e5 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h
@@ -95,7 +95,9 @@ #include <stdint.h> #endif -#if !defined(MFD_CLOEXEC) // defined only linux 3.17 or later +// MFD_CLOEXEC defined only linux 3.17 or later. +// Android wraps the memfd_create syscall from API version 30. +#if !defined(MFD_CLOEXEC) || (defined(__ANDROID__) && __ANDROID_API__ < 30) #undef XBYAK_USE_MEMFD #endif