Index: codex-rs/modcargo-crates/v8-150.4.0/build/config/compiler_cpu_abi.gn
--- codex-rs/modcargo-crates/v8-150.4.0/build/config/compiler_cpu_abi.gn.orig
+++ codex-rs/modcargo-crates/v8-150.4.0/build/config/compiler_cpu_abi.gn
@@ -48,7 +48,7 @@ if (is_chromeos_device && is_chromeos) {
 if ((is_posix && !is_apple) || is_fuchsia) {
   # simplicity we always explicitly set the architecture.
   if (current_cpu == "x64") {
-    if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
+    if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device && !is_bsd) {
       cpu_abi_cflags += [ "--target=x86_64-unknown-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
     } else {
@@ -62,7 +62,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
       cpu_abi_ldflags += [ "-march=$cros_target_cpu_arch" ]
     }
   } else if (current_cpu == "x86") {
-    if (is_clang && !is_android && !is_chromeos_device) {
+    if (is_clang && !is_android && !is_chromeos_device && !is_bsd) {
       cpu_abi_cflags += [ "--target=i386-unknown-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=i386-unknown-linux-gnu" ]
     } else {
@@ -74,7 +74,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
       "-msse3",
     ]
   } else if (current_cpu == "arm") {
-    if (is_clang && !is_android && !is_chromeos_device) {
+    if (is_clang && !is_android && !is_chromeos_device && !is_bsd) {
       cpu_abi_cflags += [ "--target=arm-linux-gnueabihf" ]
       cpu_abi_ldflags += [ "--target=arm-linux-gnueabihf" ]
     }
@@ -83,7 +83,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
       "-mfloat-abi=$arm_float_abi",
     ]
   } else if (current_cpu == "arm64") {
-    if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
+    if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device && !is_bsd) {
       cpu_abi_cflags += [ "--target=aarch64-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=aarch64-linux-gnu" ]
     }
@@ -95,7 +95,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
   } else if (current_cpu == "mipsel") {
     cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
     if (custom_toolchain == "") {
-      if (is_clang) {
+      if (is_clang && !is_bsd) {
         if (is_android) {
           cpu_abi_cflags += [ "--target=mipsel-linux-android" ]
           cpu_abi_ldflags += [ "--target=mipsel-linux-android" ]
@@ -180,7 +180,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
   } else if (current_cpu == "mips") {
     cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
     if (custom_toolchain == "") {
-      if (is_clang) {
+      if (is_clang && !is_bsd) {
         cpu_abi_cflags += [ "--target=mips-linux-gnu" ]
         cpu_abi_ldflags += [ "--target=mips-linux-gnu" ]
       } else {
@@ -226,7 +226,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
     cpu_abi_cflags += [ "-D__SANE_USERSPACE_TYPES__" ]
     cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
     if (custom_toolchain == "") {
-      if (is_clang) {
+      if (is_clang && !is_bsd) {
         if (is_android) {
           cpu_abi_cflags += [ "--target=mips64el-linux-android" ]
           cpu_abi_ldflags += [ "--target=mips64el-linux-android" ]
@@ -289,7 +289,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
   } else if (current_cpu == "mips64") {
     cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
     if (custom_toolchain == "") {
-      if (is_clang) {
+      if (is_clang && !is_bsd) {
         cpu_abi_cflags += [ "--target=mips64-linux-gnuabi64" ]
         cpu_abi_ldflags += [ "--target=mips64-linux-gnuabi64" ]
       } else {
@@ -333,7 +333,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
         cpu_abi_cflags += [ "-maix64" ]
         cpu_abi_ldflags += [ "-maix64" ]
       }
-    } else if (is_clang) {
+    } else if (is_clang && !is_bsd) {
       cpu_abi_cflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
     } else {
@@ -341,12 +341,12 @@ if ((is_posix && !is_apple) || is_fuchsia) {
       cpu_abi_ldflags += [ "-m64" ]
     }
   } else if (current_cpu == "riscv64") {
-    if (is_clang && !is_android) {
+    if (is_clang && !is_android && !is_bsd) {
       cpu_abi_cflags += [ "--target=riscv64-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=riscv64-linux-gnu" ]
     }
     cpu_abi_cflags += [ "-mabi=lp64d" ]
-  } else if (current_cpu == "loong64") {
+  } else if (current_cpu == "loong64" && !is_bsd) {
     if (is_clang) {
       cpu_abi_cflags += [ "--target=loongarch64-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=loongarch64-linux-gnu" ]
@@ -356,7 +356,7 @@ if ((is_posix && !is_apple) || is_fuchsia) {
       "-mcmodel=medium",
     ]
   } else if (current_cpu == "s390x") {
-    if (is_clang && current_os != "zos") {
+    if (is_clang && current_os != "zos" && !is_bsd) {
       cpu_abi_cflags += [ "--target=s390x-unknown-linux-gnu" ]
       cpu_abi_ldflags += [ "--target=s390x-unknown-linux-gnu" ]
     }
