[llvm] [llvm][Support][Memory] Add memfd based fallback for strict W^X Linux systems (PR #98538)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 13:08:24 PDT 2024


================
@@ -67,6 +72,24 @@ static int getPosixProtectionFlags(unsigned Flags) {
   return PROT_NONE;
 }
 
+#if defined(__linux__)
+#ifndef MFD_CLOEXEC
+#define MFD_CLOEXEC 0x0001U
+#endif
+#ifndef MFD_EXEC
+#define MFD_EXEC 0x0010U
+#endif
+
+static inline int memfd_create(const char *name, int flags) {
----------------
minipli-oss wrote:

Will do, an oversight of mine!

https://github.com/llvm/llvm-project/pull/98538


More information about the llvm-commits mailing list