summaryrefslogtreecommitdiff
path: root/www/iridium/files/patch-v8_src_flags_flags.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/iridium/files/patch-v8_src_flags_flags.cc')
-rw-r--r--www/iridium/files/patch-v8_src_flags_flags.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/www/iridium/files/patch-v8_src_flags_flags.cc b/www/iridium/files/patch-v8_src_flags_flags.cc
new file mode 100644
index 000000000000..853da2a1837e
--- /dev/null
+++ b/www/iridium/files/patch-v8_src_flags_flags.cc
@@ -0,0 +1,26 @@
+--- v8/src/flags/flags.cc.orig 2023-01-17 19:19:00 UTC
++++ v8/src/flags/flags.cc
+@@ -31,7 +31,12 @@
+ namespace v8::internal {
+
+ // Define {v8_flags}, declared in flags.h.
++#if V8_OS_OPENBSD
++#include <sys/mman.h>
++FlagValues v8_flags __attribute__((section(".openbsd.mutable")));
++#else
+ FlagValues v8_flags;
++#endif
+
+ // {v8_flags} needs to be aligned to a memory page, and the size needs to be a
+ // multiple of a page size. This is required for memory-protection of the memory
+@@ -787,6 +792,10 @@ void FlagList::FreezeFlags() {
+ // Note that for string flags we only protect the pointer itself, but not the
+ // string storage. TODO(12887): Fix this.
+ base::OS::SetDataReadOnly(&v8_flags, sizeof(v8_flags));
++#if V8_OS_OPENBSD
++ if (mimmutable(&v8_flags, sizeof(v8_flags)) == -1)
++ FATAL("unable to set immutability of v8_flags");
++#endif
+ }
+
+ // static