Index: modcargo-crates/v8-0.99.0/build/config/compiler/BUILD.gn
--- modcargo-crates/v8-0.99.0/build/config/compiler/BUILD.gn.orig
+++ modcargo-crates/v8-0.99.0/build/config/compiler/BUILD.gn
@@ -251,13 +251,16 @@ config("default_include_dirs") {
 # Compiler instrumentation can introduce dependencies in DSOs to symbols in
 # the executable they are loaded into, so they are unresolved at link-time.
 config("no_unresolved_symbols") {
-  if (!using_sanitizer &&
+  if (!using_sanitizer && !is_bsd &&
       (is_linux || is_chromeos || is_android || is_fuchsia)) {
     ldflags = [
       "-Wl,-z,defs",
       "-Wl,--as-needed",
     ]
   }
+  if (current_cpu == "x86" && is_openbsd) {
+    ldflags = [ "-Wl,-z,notext" ]
+  }
 }
 
 # compiler ---------------------------------------------------------------------
@@ -369,7 +372,7 @@ config("compiler") {
     }
 
     # Linker warnings.
-    if (fatal_linker_warnings && !is_apple && current_os != "aix" &&
+    if (fatal_linker_warnings && !is_apple && !is_openbsd && current_os != "aix" &&
         current_os != "zos") {
       ldflags += [ "-Wl,--fatal-warnings" ]
     }
@@ -481,6 +484,10 @@ config("compiler") {
     }
   }
 
+  if (is_openbsd) {
+    ldflags += [ "-Wl,-z,wxneeded" ]
+  }
+
   # Linux-specific compiler flags setup.
   # ------------------------------------
   if (use_gold) {
@@ -556,7 +563,7 @@ config("compiler") {
     ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
   }
 
-  if (is_clang && !is_nacl && current_os != "zos") {
+  if (is_clang && !is_nacl && current_os != "zos" && !is_bsd) {
     cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
     if (save_reproducers_on_lld_crash && use_lld) {
       ldflags += [
@@ -835,7 +842,7 @@ config("compiler") {
   # * Apple platforms (e.g. MacOS, iPhone, iPad) aren't supported because xcode
   #   lldb doesn't have the needed changes yet.
   # TODO(crbug.com/1379070): Remove if the upstream default ever changes.
-  if (is_clang && !is_nacl && !is_win && !is_apple) {
+  if (is_clang && !is_nacl && !is_win && !is_apple && !is_bsd) {
     cflags_cc += [ "-gsimple-template-names" ]
   }
 
@@ -1015,7 +1022,7 @@ config("compiler_cpu_abi") {
         ]
       }
     } else if (current_cpu == "arm") {
-      if (is_clang && !is_android && !is_nacl &&
+      if (is_clang && !is_android && !is_nacl && !is_bsd &&
           !(is_chromeos_lacros && is_chromeos_device)) {
         cflags += [ "--target=arm-linux-gnueabihf" ]
         ldflags += [ "--target=arm-linux-gnueabihf" ]
@@ -1030,7 +1037,7 @@ config("compiler_cpu_abi") {
         cflags += [ "-mtune=$arm_tune" ]
       }
     } else if (current_cpu == "arm64") {
-      if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
+      if (is_clang && !is_bsd && !is_android && !is_nacl && !is_fuchsia &&
           !(is_chromeos_lacros && is_chromeos_device)) {
         cflags += [ "--target=aarch64-linux-gnu" ]
         ldflags += [ "--target=aarch64-linux-gnu" ]
@@ -1369,7 +1376,7 @@ config("compiler_deterministic") {
     # different build directory like "out/feature_a" and "out/feature_b" if
     # we build same files with same compile flag.
     # Other paths are already given in relative, no need to normalize them.
-    if (is_nacl) {
+    if (is_nacl || is_bsd) {
       # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
       cflags += [
         "-Xclang",
@@ -1383,7 +1390,7 @@ config("compiler_deterministic") {
       cflags += [ "-ffile-compilation-dir=." ]
       swiftflags += [ "-file-compilation-dir=." ]
     }
-    if (!is_win) {
+    if (!is_win && !is_bsd) {
       # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
       asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
     }
@@ -1421,7 +1428,7 @@ config("compiler_deterministic") {
 }
 
 config("clang_revision") {
-  if (is_clang && clang_base_path == default_clang_base_path) {
+  if (is_clang && !is_bsd && clang_base_path == default_clang_base_path) {
     update_args = [
       "--print-revision",
       "--verify-version=$clang_version",
@@ -1675,7 +1682,7 @@ config("default_warnings") {
         cflags += [ "-Wno-builtin-assume-aligned-alignment" ]
       }
 
-      if (!is_nacl && clang_major_version >= 16) {
+      if (!is_nacl && !is_bsd && clang_major_version >= 16) {
         cflags += [
           # TODO(crbug.com/1343975) Evaluate and possibly enable.
           "-Wno-deprecated-builtins",
@@ -1953,7 +1960,7 @@ config("thin_archive") {
   # archives.
   # TODO(crbug.com/1221615): Enable on is_apple if use_lld once that no longer
   # confuses lldb.
-  if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
+  if ((is_posix && !is_bsd && !is_nacl && !is_apple) || is_fuchsia) {
     arflags = [ "-T" ]
   } else if (is_win && use_lld) {
     arflags = [ "/llvmlibthin" ]
@@ -2376,7 +2383,7 @@ config("afdo_optimize_size") {
 # There are some targeted places that AFDO regresses, so we provide a separate
 # config to allow AFDO to be disabled per-target.
 config("afdo") {
-  if (is_clang) {
+  if (is_clang && !is_bsd) {
     cflags = []
     if (clang_emit_debug_info_for_profiling) {
       # Add the following flags to generate debug info for profiling.
@@ -2395,7 +2402,7 @@ config("afdo") {
       }
       inputs = [ _clang_sample_profile ]
     }
-  } else if (auto_profile_path != "" && is_a_target_toolchain) {
+  } else if (auto_profile_path != "" && is_a_target_toolchain && !is_bsd) {
     cflags = [ "-fauto-profile=${auto_profile_path}" ]
     inputs = [ auto_profile_path ]
   }
@@ -2491,7 +2498,7 @@ config("symbols") {
     # Keeping -g2 for saigo as it's the only toolchain whose artifacts that are
     # part of chromium release (other nacl toolchains are used only for tests).
     if ((!is_nacl || is_nacl_saigo) && current_os != "zos") {
-      cflags += [ "-g2" ]
+      cflags += [ "-g0" ]
     }
 
     if (!is_nacl && is_clang && !is_tsan && !is_asan) {
@@ -2526,7 +2533,7 @@ config("symbols") {
     # DWARF info may be corrupt; offsets in a range list entry are in different
     # sections" there.  Maybe just a bug in nacl_switch_32.S.
     _enable_gdb_index =
-        symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" &&
+        symbol_level == 2 && !is_apple && !is_bsd && !is_nacl && current_cpu != "x86" &&
         current_os != "zos" && (use_gold || use_lld) &&
         # Disable on non-fission 32-bit Android because it pushes
         # libcomponents_unittests over the 4gb size limit.
@@ -2553,7 +2560,7 @@ config("symbols") {
     configs += [ "//build/config:compress_debug_sections" ]
   }
 
-  if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") {
+  if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos" && !is_bsd) {
     if (is_apple) {
       # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
       # Make sure we don't use constructor homing on mac.
