$OpenBSD: patch-v8_BUILD_gn,v 1.32 2020/03/21 14:08:01 robert Exp $

Disable v8_enable_pointer_compression because it allocates 4G+ memory.
A complete shitshow!
 
Index: v8/BUILD.gn
--- v8/BUILD.gn.orig
+++ v8/BUILD.gn
@@ -673,6 +673,9 @@ config("toolchain") {
   } else if (target_os == "win") {
     defines += [ "V8_HAVE_TARGET_OS" ]
     defines += [ "V8_TARGET_OS_WIN" ]
+  } else if (target_os == "openbsd") {
+    defines += [ "V8_HAVE_TARGET_OS" ]
+    defines += [ "V8_TARGET_OS_OPENBSD" ]
   }
 
   # TODO(jochen): Support v8_enable_prof on Windows.
@@ -3561,7 +3564,7 @@ v8_component("v8_libbase") {
     }
   }
 
-  if (is_linux) {
+  if (is_linux && !is_openbsd) {
     sources += [
       "src/base/debug/stack_trace_posix.cc",
       "src/base/platform/platform-linux.cc",
@@ -3571,6 +3574,12 @@ v8_component("v8_libbase") {
       "dl",
       "rt",
     ]
+  } else if (is_openbsd) {
+    sources += [
+      "src/base/debug/stack_trace_posix.cc",
+      "src/base/platform/platform-openbsd.cc",
+    ]
+    libs = [ "execinfo" ]
   } else if (current_os == "aix") {
     sources += [
       "src/base/debug/stack_trace_posix.cc",
