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

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 02:18:51 PDT 2024


================
@@ -177,6 +181,78 @@ std::error_code Memory::protectMappedMemory(const MemoryBlock &M,
       alignAddr((const uint8_t *)M.Address + M.AllocatedSize, PageSize);
 
   bool InvalidateCache = (Flags & MF_EXEC);
+  bool SkipMprotect = false;
+
+#if defined(__linux__)
----------------
DavidSpickett wrote:

Could this all be sunk into a helper function?
```
#if defined(__linux__)
whatever = do_a_bunch_of_stuff();
#endif
```

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


More information about the llvm-commits mailing list