$OpenBSD: patch-src_3rdparty_chromium_v8_BUILD_gn,v 1.2 2021/01/19 06:16:35 rsadowski Exp $

Index: src/3rdparty/chromium/v8/BUILD.gn
--- src/3rdparty/chromium/v8/BUILD.gn.orig
+++ src/3rdparty/chromium/v8/BUILD.gn
@@ -735,6 +735,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.
@@ -3790,7 +3793,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",
@@ -3800,6 +3803,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",
