git: 9eaaf580d946 - main - www/deno: attempt to fix the build on armv7

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Tue, 02 Sep 2025 21:11:26 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9eaaf580d94635ab60ee0c0d93da60ddb76cddd0

commit 9eaaf580d94635ab60ee0c0d93da60ddb76cddd0
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-08-31 15:29:09 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-09-02 21:07:25 +0000

    www/deno: attempt to fix the build on armv7
    
    The v8 build system tries to pass --target=arm-linux-gnueabihf to
    LLVM when building on ARM.  We are not Linux, so this confuses clang
    to the point where it no longer finds basic include files.  Remove
    that option to fix the build.  Some other ports were already patched
    the same way.
    
    With this roadblock out of the way, the port now fails as follows:
    
      In file included from ../../../deno-2.2.9/cargo-crates/v8-135.1.0/src/binding.cc:9:
      ../../../deno-2.2.9/cargo-crates/v8-135.1.0/v8/include/cppgc/allocation.h:175:9: error: static assertion failed due to requirement 'kWantedAlignment <= internal::api_constants::kMaxSupportedAlignment': Requested alignment larger than alignof(std::max_align_t) bytes. Please file a bug to possibly get this restriction lifted.
        175 |         kWantedAlignment <= internal::api_constants::kMaxSupportedAlignment,
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Approved by:    portmgr (build fix blanket)
    MFH:            2025Q3
---
 www/deno/files/patch-build_config_compiler_BUILD.gn     | 17 ++++++++++++++++-
 .../patch-v8_src_base_platform_platform-freebsd.cc      |  2 +-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/www/deno/files/patch-build_config_compiler_BUILD.gn b/www/deno/files/patch-build_config_compiler_BUILD.gn
index e13c3a8e32be..446cabbe618a 100644
--- a/www/deno/files/patch-build_config_compiler_BUILD.gn
+++ b/www/deno/files/patch-build_config_compiler_BUILD.gn
@@ -1,4 +1,4 @@
---- cargo-crates/v8-135.1.0/build/config/compiler/BUILD.gn.orig	1973-11-29 22:33:09 UTC
+--- cargo-crates/v8-135.1.0/build/config/compiler/BUILD.gn.orig	2006-07-24 01:21:28 UTC
 +++ cargo-crates/v8-135.1.0/build/config/compiler/BUILD.gn
 @@ -198,7 +198,7 @@ declare_args() {
    # This greatly reduces the size of debug builds, at the cost of
@@ -56,6 +56,21 @@
      cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
      if (save_reproducers_on_lld_crash && use_lld) {
        ldflags += [
+@@ -1235,10 +1242,10 @@ config("compiler_cpu_abi") {
+         ]
+       }
+     } else if (current_cpu == "arm") {
+-      if (is_clang && !is_android && !is_nacl && !is_chromeos_device) {
+-        cflags += [ "--target=arm-linux-gnueabihf" ]
+-        ldflags += [ "--target=arm-linux-gnueabihf" ]
+-      }
++#     if (is_clang && !is_android && !is_nacl && !is_chromeos_device) {
++#       cflags += [ "--target=arm-linux-gnueabihf" ]
++#       ldflags += [ "--target=arm-linux-gnueabihf" ]
++#     }
+       if (!is_nacl) {
+         cflags += [
+           "-march=$arm_arch",
 @@ -1249,7 +1256,7 @@ config("compiler_cpu_abi") {
          cflags += [ "-mtune=$arm_tune" ]
        }
diff --git a/www/deno/files/patch-v8_src_base_platform_platform-freebsd.cc b/www/deno/files/patch-v8_src_base_platform_platform-freebsd.cc
index c2f65ad6363f..d3cc6f81b281 100644
--- a/www/deno/files/patch-v8_src_base_platform_platform-freebsd.cc
+++ b/www/deno/files/patch-v8_src_base_platform_platform-freebsd.cc
@@ -20,7 +20,7 @@
              lib_name = std::string(path);
            }
            result.push_back(SharedLibraryAddress(
-+#if defined(__i386__) || defined(OS_FREEBSD)
++#if defined(__arm__) || defined(__i386__) || defined(OS_FREEBSD)
 +              lib_name, static_cast<uintptr_t>(map->kve_start),
 +              static_cast<uintptr_t>(map->kve_end)));
 +#else