git: f366d9631672 - main - lang/v8-beta: Add v8-beta 9.6.180.5
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 01 Nov 2021 13:45:14 UTC
The branch main has been updated by sunpoet:
URL: https://cgit.FreeBSD.org/ports/commit/?id=f366d96316722f0acfe0183f844e6fd3d6a5d80a
commit f366d96316722f0acfe0183f844e6fd3d6a5d80a
Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2021-11-01 13:23:13 +0000
Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-11-01 13:41:20 +0000
lang/v8-beta: Add v8-beta 9.6.180.5
Changes: https://v8.dev/blog/v8-release-96
https://chromium.googlesource.com/v8/v8.git/+log/refs/heads/9.6-lkgr
https://github.com/v8/v8/commits/9.6-lkgr
---
lang/Makefile | 1 +
lang/v8-beta/Makefile | 107 ++++++++++++++++++++
lang/v8-beta/distinfo | 17 ++++
lang/v8-beta/files/patch-BUILD.gn | 32 ++++++
lang/v8-beta/files/patch-build_config_BUILD.gn | 30 ++++++
.../files/patch-build_config_BUILDCONFIG.gn | 44 ++++++++
.../files/patch-build_config_compiler_BUILD.gn | 101 +++++++++++++++++++
.../files/patch-build_config_compiler_compiler.gni | 11 ++
lang/v8-beta/files/patch-build_config_features.gni | 11 ++
.../files/patch-build_config_freetype_freetype.gni | 9 ++
.../files/patch-build_config_linux_BUILD.gn | 11 ++
.../files/patch-build_config_linux_pkg-config.py | 26 +++++
lang/v8-beta/files/patch-build_config_rust.gni | 11 ++
lang/v8-beta/files/patch-build_config_sysroot.gni | 14 +++
.../files/patch-build_detect__host__arch.py | 11 ++
lang/v8-beta/files/patch-build_gn__run__binary.py | 11 ++
lang/v8-beta/files/patch-build_linux_chrome.map | 29 ++++++
.../files/patch-build_linux_libpci_BUILD.gn | 53 ++++++++++
.../files/patch-build_linux_unbundle_libusb.gn | 27 +++++
...atch-build_linux_unbundle_replace__gn__files.py | 10 ++
.../files/patch-build_toolchain_gcc__toolchain.gni | 45 +++++++++
...patch-build_toolchain_get__concurrent__links.py | 17 ++++
.../files/patch-build_toolchain_linux_BUILD.gn | 10 ++
.../patch-buildtools_third__party_libc++_BUILD.gn | 10 ++
lang/v8-beta/files/patch-include_v8config.h | 21 ++++
lang/v8-beta/files/patch-src_api_api.cc | 11 ++
lang/v8-beta/files/patch-src_base_cpu.cc | 18 ++++
.../patch-src_base_platform_platform-freebsd.cc | 13 +++
.../patch-src_base_platform_platform-posix.cc | 24 +++++
lang/v8-beta/files/patch-src_d8_d8-posix.cc | 19 ++++
.../v8-beta/files/patch-third__party_zlib_BUILD.gn | 11 ++
.../files/patch-third__party_zlib_cpu__features.c | 48 +++++++++
lang/v8-beta/files/v8.pc.in | 11 ++
lang/v8-beta/files/v8_libbase.pc.in | 10 ++
lang/v8-beta/files/v8_libplatform.pc.in | 10 ++
lang/v8-beta/pkg-descr | 14 +++
lang/v8-beta/pkg-plist | 112 +++++++++++++++++++++
37 files changed, 970 insertions(+)
diff --git a/lang/Makefile b/lang/Makefile
index 2ab54b67d32a..e35bd548f879 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -357,6 +357,7 @@
SUBDIR += urweb
SUBDIR += v
SUBDIR += v8
+ SUBDIR += v8-beta
SUBDIR += vala
SUBDIR += visualworks
SUBDIR += voc
diff --git a/lang/v8-beta/Makefile b/lang/v8-beta/Makefile
new file mode 100644
index 000000000000..adea349bf6bb
--- /dev/null
+++ b/lang/v8-beta/Makefile
@@ -0,0 +1,107 @@
+# We follow the beta channel on https://omahaproxy.appspot.com/
+# https://chromium.googlesource.com/v8/v8/+/refs/heads/9.6-lkgr
+
+PORTNAME= v8
+PORTVERSION= 9.6.180.5
+CATEGORIES= lang
+MASTER_SITES= LOCAL/sunpoet/v8/${PORTVERSION:R:R}
+DISTFILES= build-${BUILD_REV}.tar.gz \
+ buildtools-${BUILDTOOLS_REV}.tar.gz \
+ clang-${CLANG_REV}.tar.gz \
+ common-${COMMON_REV}.tar.gz \
+ googletest-${GOOGLETEST_REV}.tar.gz \
+ icu-${ICU_REV}.tar.gz \
+ zlib-${ZLIB_REV}.tar.gz
+EXTRACT_ONLY= ${DISTNAME}.tar.gz
+DIST_SUBDIR= v8/${PORTVERSION:R:R}
+PKGNAMESUFFIX= -beta
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Open source JavaScript engine by Google
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= binutils>=0:devel/binutils \
+ gn:devel/gn \
+ ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR}
+LIB_DEPENDS= libicudata.so:devel/icu
+
+USES= compiler:c++17-lang cpe gnome ninja pkgconfig python:3.5+,build tar:xz
+USE_GNOME= glib20
+
+BINARY_ALIAS= python3=${PYTHON_CMD}
+MAKE_ARGS= -C out/Release
+USE_LDCONFIG= yes
+
+SUB_FILES= v8.pc v8_libbase.pc v8_libplatform.pc
+
+USE_GITHUB= yes
+
+CPE_VENDOR= google
+
+CONFLICTS_INSTALL= v8
+
+BUILD_REV= ebad8533842661f66b9b905e0ee9890a32f628d5
+BUILDTOOLS_REV= a9bc3e283182a586998338a665c7eae17406ec54
+CLANG_REV= c06edd1f455183fc89e9f8c2cf745db8f564d8ea
+COMMON_REV= 68d816952258c9d817bba656ee2664b35507f01b
+GOOGLETEST_REV= 3b49be074d5c1340eeb447e6a8e78427051e675a
+ICU_REV= 3f443830bd52d3aa5fab3c1aa2b6d0848bb5039d
+ZLIB_REV= dfa96e81458fb3b39676e45f7e9e000dff789b05
+
+# Run "gn args --list out/Release" for all variables.
+# Some parts don't have use_system_* flag, and can be turned on/off by using
+# replace_gn_files.py script, some parts just turned on/off for target host
+# OS "target_os == is_bsd", like libusb, libpci.
+GN_ARGS+= clang_use_chrome_plugins=false \
+ extra_cxxflags="${CXXFLAGS}" \
+ extra_ldflags="${LDFLAGS}" \
+ is_clang=true \
+ treat_warnings_as_errors=false \
+ use_aura=true \
+ use_lld=true \
+ use_custom_libcxx=false \
+ v8_use_external_startup_data=false
+
+post-extract:
+ @${MKDIR} ${WRKSRC}/base/trace_event/common ${WRKSRC}/build ${WRKSRC}/buildtools ${WRKSRC}/third_party/googletest/src ${WRKSRC}/third_party/icu ${WRKSRC}/third_party/zlib ${WRKSRC}/tools/clang
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/build-${BUILD_REV}.tar.gz -C ${WRKSRC}/build
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/buildtools-${BUILDTOOLS_REV}.tar.gz -C ${WRKSRC}/buildtools
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/clang-${CLANG_REV}.tar.gz -C ${WRKSRC}/tools/clang
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/common-${COMMON_REV}.tar.gz -C ${WRKSRC}/base/trace_event/common
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/googletest-${GOOGLETEST_REV}.tar.gz -C ${WRKSRC}/third_party/googletest/src
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/icu-${ICU_REV}.tar.gz -C ${WRKSRC}/third_party/icu
+ @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/zlib-${ZLIB_REV}.tar.gz -C ${WRKSRC}/third_party/zlib
+
+post-patch:
+ @${REINPLACE_CMD} -i '' 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/build/toolchain/gcc_toolchain.gni ${WRKSRC}/buildtools/third_party/libc++/BUILD.gn
+ # https://github.com/klzgrad/naiveproxy/blob/master/src/build/config/gclient_args.gni
+ ${ECHO_CMD} 'checkout_google_benchmark = false' > ${WRKSRC}/build/config/gclient_args.gni
+
+# Use ICU from ports and create needed directory
+pre-configure:
+ @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} ./build/linux/unbundle/replace_gn_files.py --system-libraries icu # || ${FALSE}
+ @${MKDIR} ${WRKSRC}/out/Release/gen/shim_headers/icui18n_shim/third_party/icu/source/i18n/unicode ${WRKSRC}/out/Release/gen/shim_headers/icuuc_shim/third_party/icu/source/common/unicode
+ @${MKDIR} ${WRKSRC}/out/Release/gen/include
+ @${CP} -R ${LOCALBASE}/include/unicode ${WRKSRC}/out/Release/gen/include/unicode
+
+do-configure:
+ @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} gn gen out/Release --args='${GN_ARGS}'
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/include/cppgc ${STAGEDIR}${PREFIX}/include/libplatform
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/d8 ${STAGEDIR}${PREFIX}/bin/d8
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/mkgrokdump ${STAGEDIR}${PREFIX}/bin/mkgrokdump
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/mksnapshot ${STAGEDIR}${PREFIX}/bin/mksnapshot
+ ${INSTALL_LIB} ${WRKSRC}/out/Release/libchrome_zlib.so ${STAGEDIR}${PREFIX}/lib/libchrome_zlib.so
+ ${INSTALL_LIB} ${WRKSRC}/out/Release/libcppgc.so ${STAGEDIR}${PREFIX}/lib/libcppgc.so
+ ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so
+ ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8_libbase.so ${STAGEDIR}${PREFIX}/lib/libv8_libbase.so
+ ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8_libplatform.so ${STAGEDIR}${PREFIX}/lib/libv8_libplatform.so
+ ${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/
+ cd ${WRKSRC}/include/cppgc && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/cppgc '-name *\.h'
+ ${INSTALL_DATA} ${WRKSRC}/include/libplatform/*.h ${STAGEDIR}${PREFIX}/include/libplatform/
+ ${INSTALL_DATA} ${WRKDIR}/v8*.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig/
+
+.include <bsd.port.mk>
diff --git a/lang/v8-beta/distinfo b/lang/v8-beta/distinfo
new file mode 100644
index 000000000000..b0f8cdb397c9
--- /dev/null
+++ b/lang/v8-beta/distinfo
@@ -0,0 +1,17 @@
+TIMESTAMP = 1635730869
+SHA256 (v8/9.6/build-ebad8533842661f66b9b905e0ee9890a32f628d5.tar.gz) = d8e9e21f48b0a88f456d88bb76fe6381ba2d3429c36f371dbabf11f50c704468
+SIZE (v8/9.6/build-ebad8533842661f66b9b905e0ee9890a32f628d5.tar.gz) = 1357606
+SHA256 (v8/9.6/buildtools-a9bc3e283182a586998338a665c7eae17406ec54.tar.gz) = 4aaec99b3c5cc9bf588a5ddd76efdc024276097a9bdddf1364936f9ddcdf7f78
+SIZE (v8/9.6/buildtools-a9bc3e283182a586998338a665c7eae17406ec54.tar.gz) = 86607
+SHA256 (v8/9.6/clang-c06edd1f455183fc89e9f8c2cf745db8f564d8ea.tar.gz) = 1f03b84dad25f4b80fcb137e00be9efc9f0503146103ec4ac6b792df78700aa7
+SIZE (v8/9.6/clang-c06edd1f455183fc89e9f8c2cf745db8f564d8ea.tar.gz) = 288468
+SHA256 (v8/9.6/common-68d816952258c9d817bba656ee2664b35507f01b.tar.gz) = 6d84abfe22276bf1940b617aa8c320ec098d40c7d6dc83978b157836061f5c34
+SIZE (v8/9.6/common-68d816952258c9d817bba656ee2664b35507f01b.tar.gz) = 10624
+SHA256 (v8/9.6/googletest-3b49be074d5c1340eeb447e6a8e78427051e675a.tar.gz) = 75be476046d5135185521ed95a8c03872d6eb1ff3a2d956ee7d0739936492df6
+SIZE (v8/9.6/googletest-3b49be074d5c1340eeb447e6a8e78427051e675a.tar.gz) = 830864
+SHA256 (v8/9.6/icu-3f443830bd52d3aa5fab3c1aa2b6d0848bb5039d.tar.gz) = 033b914dba13dbb5599ab1e21c652d707c3b5d96184c535c6a3dc65f6c0d610b
+SIZE (v8/9.6/icu-3f443830bd52d3aa5fab3c1aa2b6d0848bb5039d.tar.gz) = 43801217
+SHA256 (v8/9.6/zlib-dfa96e81458fb3b39676e45f7e9e000dff789b05.tar.gz) = aefe670a752dd8ac2e6d3e9820cdcb83f660a849750d6da1301bb06be97a2528
+SIZE (v8/9.6/zlib-dfa96e81458fb3b39676e45f7e9e000dff789b05.tar.gz) = 313143
+SHA256 (v8/9.6/v8-v8-9.6.180.5_GH0.tar.gz) = 6fa5963df6af3d10479294bd1194b52fbecc558234ae0dbe6bee21360fb96932
+SIZE (v8/9.6/v8-v8-9.6.180.5_GH0.tar.gz) = 27104492
diff --git a/lang/v8-beta/files/patch-BUILD.gn b/lang/v8-beta/files/patch-BUILD.gn
new file mode 100644
index 000000000000..f39f14add820
--- /dev/null
+++ b/lang/v8-beta/files/patch-BUILD.gn
@@ -0,0 +1,32 @@
+--- BUILD.gn.orig 2021-10-06 18:22:58 UTC
++++ BUILD.gn
+@@ -4804,7 +4804,7 @@ v8_component("v8_libbase") {
+ }
+ }
+
+- if (is_linux || is_chromeos) {
++ if ((is_linux || is_chromeos) && !is_bsd) {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
+ "src/base/platform/platform-linux.cc",
+@@ -4821,6 +4821,12 @@ v8_component("v8_libbase") {
+ ]
+
+ libs = [ "dl" ]
++ } else if (is_bsd) {
++ sources += [
++ "src/base/debug/stack_trace_posix.cc",
++ "src/base/platform/platform-freebsd.cc",
++ ]
++ libs = [ "rt", "execinfo" ]
+ } else if (is_android) {
+ if (current_toolchain == host_toolchain) {
+ libs = [
+@@ -5313,6 +5319,7 @@ if (v8_monolithic) {
+ ":v8_libplatform",
+ "//build/win:default_exe_manifest",
+ ]
++ libs = ["execinfo"]
+
+ configs = [ ":internal_config" ]
+ }
diff --git a/lang/v8-beta/files/patch-build_config_BUILD.gn b/lang/v8-beta/files/patch-build_config_BUILD.gn
new file mode 100644
index 000000000000..862adcb37658
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_BUILD.gn
@@ -0,0 +1,30 @@
+--- build/config/BUILD.gn.orig 2021-05-26 12:26:11 UTC
++++ build/config/BUILD.gn
+@@ -128,7 +128,7 @@ config("debug") {
+ # builds, and we have to tell it to turn it off.
+ defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
+ }
+- } else if ((is_linux || is_chromeos) && current_cpu == "x64" &&
++ } else if ((is_linux || is_chromeos || is_bsd) && current_cpu == "x64" &&
+ enable_iterator_debugging) {
+ # Enable libstdc++ debugging facilities to help catch problems early, see
+ # http://crbug.com/65151 .
+@@ -227,9 +227,7 @@ config("default_libs") {
+ ]
+ } else if (is_linux || is_chromeos) {
+ libs = [
+- "dl",
+ "pthread",
+- "rt",
+ ]
+ }
+ }
+@@ -308,7 +306,7 @@ config("executable_config") {
+ "//build/config/ios:ios_dynamic_flags",
+ "//build/config/ios:ios_executable_flags",
+ ]
+- } else if (is_linux || is_chromeos || is_android || current_os == "aix") {
++ } else if (is_linux || is_bsd || is_chromeos || is_android || current_os == "aix") {
+ configs += [ "//build/config/gcc:executable_config" ]
+ if (is_chromecast) {
+ configs += [ "//build/config/chromecast:executable_config" ]
diff --git a/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn b/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn
new file mode 100644
index 000000000000..926e6acaf504
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn
@@ -0,0 +1,44 @@
+--- build/config/BUILDCONFIG.gn.orig 2021-05-26 12:26:11 UTC
++++ build/config/BUILDCONFIG.gn
+@@ -131,7 +131,7 @@ declare_args() {
+ is_official_build = false
+
+ # Set to true when compiling with the Clang compiler.
+- is_clang = current_os != "linux" ||
++ is_clang = current_os != "linux" || current_os == "freebsd" ||
+ (current_cpu != "s390x" && current_cpu != "s390" &&
+ current_cpu != "ppc64" && current_cpu != "ppc" &&
+ current_cpu != "mips" && current_cpu != "mips64" &&
+@@ -184,8 +184,8 @@ if (host_toolchain == "") {
+ # TODO(dpranke): Add some sort of assert here that verifies that
+ # no toolchain omitted host_toolchain from its toolchain_args().
+
+- if (host_os == "linux") {
+- if (target_os != "linux") {
++ if (host_os == "linux" || host_os == "freebsd") {
++ if (target_os != "linux" && target_os != "freebsd") {
+ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
+ } else if (is_clang) {
+ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
+@@ -222,7 +222,7 @@ if (target_os == "android") {
+ assert(host_os == "linux" || host_os == "mac",
+ "Android builds are only supported on Linux and Mac hosts.")
+ _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu"
+-} else if (target_os == "chromeos" || target_os == "linux") {
++} else if (target_os == "chromeos" || target_os == "linux" || target_os == "freebsd") {
+ # See comments in build/toolchain/cros/BUILD.gn about board compiles.
+ if (is_clang) {
+ _default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
+@@ -287,10 +287,11 @@ is_android = current_os == "android"
+ is_chromeos = current_os == "chromeos"
+ is_fuchsia = current_os == "fuchsia"
+ is_ios = current_os == "ios"
+-is_linux = current_os == "linux"
++is_linux = current_os == "linux" || current_os == "freebsd"
+ is_mac = current_os == "mac"
+ is_nacl = current_os == "nacl"
+ is_win = current_os == "win" || current_os == "winuwp"
++is_bsd = current_os == "freebsd"
+
+ is_apple = is_ios || is_mac
+ is_posix = !is_win && !is_fuchsia
diff --git a/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn b/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn
new file mode 100644
index 000000000000..20c0c04bcf4c
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn
@@ -0,0 +1,101 @@
+--- build/config/compiler/BUILD.gn.orig 2021-10-20 15:47:54 UTC
++++ build/config/compiler/BUILD.gn
+@@ -140,7 +140,7 @@ declare_args() {
+ #
+ # TODO(crbug.com/1131993): Enabling this when 'is_android' is true breaks
+ # content_shell_test_apk on both ARM and x86.
+- init_stack_vars = !is_android
++ init_stack_vars = !is_android && !is_bsd
+
+ # This argument is to control whether enabling text section splitting in the
+ # final binary. When enabled, the separated text sections with prefix
+@@ -355,7 +355,7 @@ config("compiler") {
+ }
+
+ # Linker warnings.
+- if (fatal_linker_warnings && !is_apple && current_os != "aix") {
++ if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix") {
+ ldflags += [ "-Wl,--fatal-warnings" ]
+ }
+ if (fatal_linker_warnings && is_apple) {
+@@ -531,7 +531,7 @@ config("compiler") {
+ ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
+ }
+
+- if (is_clang && !is_nacl && !use_xcode_clang) {
++ if (is_clang && !is_nacl && !use_xcode_clang && !is_bsd) {
+ cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
+
+ # TODO(hans): Remove this once Clang generates better optimized debug info
+@@ -909,7 +909,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_android && !is_nacl && !is_fuchsia && !is_bsd) {
+ cflags += [ "--target=aarch64-linux-gnu" ]
+ ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
+@@ -1253,7 +1253,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",
+@@ -1266,7 +1266,7 @@ config("compiler_deterministic") {
+ # and -fcoverage-compilation-dir=.
+ cflags += [ "-ffile-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,." ]
+ }
+@@ -1650,7 +1650,7 @@ config("default_warnings") {
+ cflags += [ "-Wno-null-pointer-subtraction" ]
+ }
+
+- if (current_toolchain == host_toolchain || !use_xcode_clang) {
++ if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
+ # Flags Xcode 9.2 (Clang clang-900.0.39.2) does not recognize.
+ cflags += [
+ "-Wenum-compare-conditional",
+@@ -1904,7 +1904,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_nacl && !is_apple && !is_bsd) || is_fuchsia) {
+ arflags = [ "-T" ]
+ } else if (is_win && use_lld) {
+ arflags = [ "/llvmlibthin" ]
+@@ -2404,7 +2404,7 @@ config("symbols") {
+ # flag, so we can use use -g1 for pnacl and nacl-clang compiles.
+ # gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
+ if (!is_nacl || is_clang) {
+- cflags += [ "-g2" ]
++ cflags += [ "-g0" ]
+ }
+
+ if (!is_nacl && is_clang && !is_tsan && !is_asan) {
+@@ -2439,7 +2439,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.
+ if (!is_apple && !is_nacl && current_cpu != "x86" &&
+- (use_gold || use_lld)) {
++ (use_gold || use_lld) && !is_bsd) {
+ if (is_clang) {
+ # This flag enables the GNU-format pubnames and pubtypes sections,
+ # which lld needs in order to generate a correct GDB index.
+@@ -2452,7 +2452,7 @@ config("symbols") {
+ }
+
+ if (is_clang && !is_nacl && !use_xcode_clang) {
+- if (is_apple) {
++ if (is_apple || is_bsd) {
+ # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
+ # Make sure we don't use constructor homing on mac.
+ cflags += [
diff --git a/lang/v8-beta/files/patch-build_config_compiler_compiler.gni b/lang/v8-beta/files/patch-build_config_compiler_compiler.gni
new file mode 100644
index 000000000000..b40ee50f0b69
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_compiler_compiler.gni
@@ -0,0 +1,11 @@
+--- build/config/compiler/compiler.gni.orig 2021-10-13 07:49:03 UTC
++++ build/config/compiler/compiler.gni
+@@ -205,7 +205,7 @@ declare_args() {
+
+ declare_args() {
+ # Whether to use the gold linker from binutils instead of lld or bfd.
+- use_gold = !use_lld && !(is_chromecast && is_linux &&
++ use_gold = !use_lld && !is_bsd && !(is_chromecast && is_linux &&
+ (current_cpu == "arm" || current_cpu == "mipsel")) &&
+ (((is_linux || is_chromeos_lacros) &&
+ (current_cpu == "x64" || current_cpu == "x86" ||
diff --git a/lang/v8-beta/files/patch-build_config_features.gni b/lang/v8-beta/files/patch-build_config_features.gni
new file mode 100644
index 000000000000..4469d4f06273
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_features.gni
@@ -0,0 +1,11 @@
+--- build/config/features.gni.orig 2020-09-19 19:50:44 UTC
++++ build/config/features.gni
+@@ -26,7 +26,7 @@ declare_args() {
+ proprietary_codecs = is_chrome_branded || is_chromecast
+
+ # libudev usage. This currently only affects the content layer.
+- use_udev = (is_linux || is_chromeos) && !is_chromecast
++ use_udev = (is_linux || is_chromeos) && !is_chromecast && !is_bsd
+
+ use_dbus = (is_linux || is_chromeos) && !is_chromecast
+
diff --git a/lang/v8-beta/files/patch-build_config_freetype_freetype.gni b/lang/v8-beta/files/patch-build_config_freetype_freetype.gni
new file mode 100644
index 000000000000..17bed01510f8
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_freetype_freetype.gni
@@ -0,0 +1,9 @@
+--- build/config/freetype/freetype.gni.orig 2019-03-18 08:59:45 UTC
++++ build/config/freetype/freetype.gni
+@@ -10,5 +10,5 @@ declare_args() {
+ # than version 2.7.1 and have color bitmap support compiled in. WARNING:
+ # System FreeType configurations other than as described WILL INTRODUCE TEXT
+ # RENDERING AND SECURITY REGRESSIONS.
+- use_system_freetype = false
++ use_system_freetype = true
+ }
diff --git a/lang/v8-beta/files/patch-build_config_linux_BUILD.gn b/lang/v8-beta/files/patch-build_config_linux_BUILD.gn
new file mode 100644
index 000000000000..9b9bb1d634f9
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_linux_BUILD.gn
@@ -0,0 +1,11 @@
+--- build/config/linux/BUILD.gn.orig 2021-10-13 07:49:03 UTC
++++ build/config/linux/BUILD.gn
+@@ -39,7 +39,7 @@ config("runtime_library") {
+
+ if ((!(is_chromeos_ash || is_chromeos_lacros) ||
+ default_toolchain != "//build/toolchain/cros:target") &&
+- (!use_custom_libcxx || current_cpu == "mipsel")) {
++ (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) {
+ libs = [ "atomic" ]
+ }
+ }
diff --git a/lang/v8-beta/files/patch-build_config_linux_pkg-config.py b/lang/v8-beta/files/patch-build_config_linux_pkg-config.py
new file mode 100644
index 000000000000..8a2865a024c0
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_linux_pkg-config.py
@@ -0,0 +1,26 @@
+--- build/config/linux/pkg-config.py.orig 2019-07-24 18:58:02 UTC
++++ build/config/linux/pkg-config.py
+@@ -59,8 +59,12 @@ def SetConfigPath(options):
+ print("You must specify an architecture via -a if using a sysroot.")
+ sys.exit(1)
+
+- libdir = sysroot + '/usr/' + options.system_libdir + '/pkgconfig'
+- libdir += ':' + sysroot + '/usr/share/pkgconfig'
++ if "linux" in sys.platform:
++ libdir = sysroot + '/libdata/' + options.system_libdir + '/pkgconfig'
++ libdir += ':' + sysroot + '/usr/share/pkgconfig'
++ elif "bsd" in sys.platform:
++ libdir = sysroot + '/libdata/pkgconfig'
++ libdir += ':' + '/usr/libdata/pkgconfig'
+ os.environ['PKG_CONFIG_LIBDIR'] = libdir
+ return libdir
+
+@@ -109,7 +113,7 @@ def main():
+ # If this is run on non-Linux platforms, just return nothing and indicate
+ # success. This allows us to "kind of emulate" a Linux build from other
+ # platforms.
+- if "linux" not in sys.platform:
++ if "bsd" not in sys.platform:
+ print("[[],[],[],[],[]]")
+ return 0
+
diff --git a/lang/v8-beta/files/patch-build_config_rust.gni b/lang/v8-beta/files/patch-build_config_rust.gni
new file mode 100644
index 000000000000..b272ec620862
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_rust.gni
@@ -0,0 +1,11 @@
+--- build/config/rust.gni.orig 2021-10-20 15:47:54 UTC
++++ build/config/rust.gni
+@@ -58,7 +58,7 @@ toolchain_has_official_rust =
+ (!is_nacl &&
+ (is_android && (current_cpu == "arm" || current_cpu == "arm64" ||
+ current_cpu == "x64" || current_cpu == "x86"))) ||
+- (is_linux && current_cpu == "x64")
++ (current_os == "linux" && current_cpu == "x64")
+
+ toolchain_has_rust = enable_rust && (toolchain_has_official_rust ||
+ use_unverified_rust_toolchain)
diff --git a/lang/v8-beta/files/patch-build_config_sysroot.gni b/lang/v8-beta/files/patch-build_config_sysroot.gni
new file mode 100644
index 000000000000..8b68404769fb
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_config_sysroot.gni
@@ -0,0 +1,14 @@
+--- build/config/sysroot.gni.orig 2020-05-13 18:39:36 UTC
++++ build/config/sysroot.gni
+@@ -21,9 +21,9 @@ declare_args() {
+
+ # Controls default is_linux sysroot. If set to true, and sysroot
+ # is empty, default sysroot is calculated.
+- use_sysroot = current_cpu == "x86" || current_cpu == "x64" ||
++ use_sysroot = !is_bsd && (current_cpu == "x86" || current_cpu == "x64" ||
+ current_cpu == "arm" || current_cpu == "arm64" ||
+- current_cpu == "mipsel" || current_cpu == "mips64el"
++ current_cpu == "mipsel" || current_cpu == "mips64el")
+ }
+
+ if (sysroot == "") {
diff --git a/lang/v8-beta/files/patch-build_detect__host__arch.py b/lang/v8-beta/files/patch-build_detect__host__arch.py
new file mode 100644
index 000000000000..588896662607
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_detect__host__arch.py
@@ -0,0 +1,11 @@
+--- build/detect_host_arch.py.orig 2019-07-24 18:58:02 UTC
++++ build/detect_host_arch.py
+@@ -21,6 +21,8 @@ def HostArch():
+ host_arch = 'ia32'
+ elif host_arch in ['x86_64', 'amd64']:
+ host_arch = 'x64'
++ elif host_arch.startswith('arm64'):
++ host_arch = 'arm64'
+ elif host_arch.startswith('arm'):
+ host_arch = 'arm'
+ elif host_arch.startswith('aarch64'):
diff --git a/lang/v8-beta/files/patch-build_gn__run__binary.py b/lang/v8-beta/files/patch-build_gn__run__binary.py
new file mode 100644
index 000000000000..d9e733834b4a
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_gn__run__binary.py
@@ -0,0 +1,11 @@
+--- build/gn_run_binary.py.orig 2019-07-24 18:58:02 UTC
++++ build/gn_run_binary.py
+@@ -24,7 +24,7 @@ if not os.path.isabs(path):
+ # The rest of the arguments are passed directly to the executable.
+ args = [path] + sys.argv[2:]
+
+-ret = subprocess.call(args)
++ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome"})
+ if ret != 0:
+ if ret <= -100:
+ # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to
diff --git a/lang/v8-beta/files/patch-build_linux_chrome.map b/lang/v8-beta/files/patch-build_linux_chrome.map
new file mode 100644
index 000000000000..f540509b3054
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_linux_chrome.map
@@ -0,0 +1,29 @@
+--- build/linux/chrome.map.orig 2021-05-01 21:15:31 UTC
++++ build/linux/chrome.map
+@@ -1,4 +1,7 @@
+ {
++local:
++ *;
++
+ global:
+ __bss_start;
+ __data_start;
+@@ -20,6 +23,10 @@ global:
+ # Program entry point.
+ _start;
+
++ # FreeBSD specific variables.
++ __progname;
++ environ;
++
+ # Memory allocation symbols. We want chrome and any libraries to
+ # share the same heap, so it is correct to export these symbols.
+ calloc;
+@@ -83,7 +90,4 @@ global:
+ localtime_r;
+
+ v8dbg_*;
+-
+-local:
+- *;
+ };
diff --git a/lang/v8-beta/files/patch-build_linux_libpci_BUILD.gn b/lang/v8-beta/files/patch-build_linux_libpci_BUILD.gn
new file mode 100644
index 000000000000..86373b5ebf39
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_linux_libpci_BUILD.gn
@@ -0,0 +1,53 @@
+--- build/linux/libpci/BUILD.gn.orig 2019-03-11 22:00:52 UTC
++++ build/linux/libpci/BUILD.gn
+@@ -3,20 +3,36 @@
+ # found in the LICENSE file.
+
+ import("//tools/generate_library_loader/generate_library_loader.gni")
++import("//build/config/linux/pkg_config.gni")
+
+-# This generates a target named "libpci".
+-generate_library_loader("libpci") {
+- name = "LibPciLoader"
+- output_h = "libpci.h"
+- output_cc = "libpci_loader.cc"
+- header = "<pci/pci.h>"
++declare_args() {
++ use_system_libpci = is_bsd
++}
+
+- functions = [
+- "pci_alloc",
+- "pci_init",
+- "pci_cleanup",
+- "pci_scan_bus",
+- "pci_fill_info",
+- "pci_lookup_name",
+- ]
++if (use_system_libpci) {
++ pkg_config("system_libpci") {
++ packages = [ "libpci" ]
++ }
++
++ source_set("libpci") {
++ public_configs = [ ":system_libpci" ]
++ }
++
++} else {
++ # This generates a target named "libpci".
++ generate_library_loader("libpci") {
++ name = "LibPciLoader"
++ output_h = "libpci.h"
++ output_cc = "libpci_loader.cc"
++ header = "<pci/pci.h>"
++
++ functions = [
++ "pci_alloc",
++ "pci_init",
++ "pci_cleanup",
++ "pci_scan_bus",
++ "pci_fill_info",
++ "pci_lookup_name",
++ ]
++ }
+ }
diff --git a/lang/v8-beta/files/patch-build_linux_unbundle_libusb.gn b/lang/v8-beta/files/patch-build_linux_unbundle_libusb.gn
new file mode 100644
index 000000000000..1cc0b00012c6
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_linux_unbundle_libusb.gn
@@ -0,0 +1,27 @@
+--- build/linux/unbundle/libusb.gn.orig 2019-03-17 01:47:13 UTC
++++ build/linux/unbundle/libusb.gn
+@@ -0,0 +1,24 @@
++# Copyright 2016 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/linux/pkg_config.gni")
++import("//build/shim_headers.gni")
++
++pkg_config("system_libusb") {
++ packages = [ "libusb-1.0" ]
++}
++
++shim_headers("libusb_shim") {
++ root_path = "src/libusb"
++ headers = [
++ "libusb.h",
++ ]
++}
++
++source_set("libusb") {
++ deps = [
++ ":libusb_shim",
++ ]
++ public_configs = [ ":system_libusb" ]
++}
diff --git a/lang/v8-beta/files/patch-build_linux_unbundle_replace__gn__files.py b/lang/v8-beta/files/patch-build_linux_unbundle_replace__gn__files.py
new file mode 100644
index 000000000000..ca2d4fd5e12e
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_linux_unbundle_replace__gn__files.py
@@ -0,0 +1,10 @@
+--- build/linux/unbundle/replace_gn_files.py.orig 2019-03-11 22:00:52 UTC
++++ build/linux/unbundle/replace_gn_files.py
+@@ -27,6 +27,7 @@ REPLACEMENTS = {
+ 'libevent': 'base/third_party/libevent/BUILD.gn',
+ 'libjpeg': 'third_party/libjpeg.gni',
+ 'libpng': 'third_party/libpng/BUILD.gn',
++ 'libusb': 'third_party/libusb/BUILD.gn',
+ 'libvpx': 'third_party/libvpx/BUILD.gn',
+ 'libwebp': 'third_party/libwebp/BUILD.gn',
+ 'libxml': 'third_party/libxml/BUILD.gn',
diff --git a/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni b/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni
new file mode 100644
index 000000000000..528964d2bc7d
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni
@@ -0,0 +1,45 @@
+--- build/toolchain/gcc_toolchain.gni.orig 2021-10-13 07:49:03 UTC
++++ build/toolchain/gcc_toolchain.gni
+@@ -48,6 +48,11 @@ if (enable_resource_allowlist_generation) {
+ "enable_resource_allowlist_generation=true does not work for target_os=$target_os")
+ }
+
++declare_args() {
++ extra_cxxflags = ""
++ extra_ldflags = ""
++}
++
+ # This template defines a toolchain for something that works like gcc
+ # (including clang).
+ #
+@@ -673,13 +678,23 @@ template("clang_toolchain") {
+ }
+
+ gcc_toolchain(target_name) {
+- prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+- cc = "$prefix/clang"
+- cxx = "$prefix/clang++"
+- ld = cxx
+- readelf = "${toolprefix}readelf"
+- ar = "${prefix}/llvm-ar"
+- nm = "${prefix}/llvm-nm"
++ if (is_bsd) {
++ prefix = "%%LOCALBASE%%/bin"
++ cc = "cc"
++ cxx = "c++"
++ ld = cxx
++ readelf = "${toolprefix}readelf"
++ ar = "${prefix}/ar"
++ nm = "${prefix}/nm"
++ } else {
++ prefix = rebase_path("$clang_base_path/bin", root_build_dir)
++ cc = "$prefix/clang"
++ cxx = "$prefix/clang++"
++ ld = cxx
++ readelf = "${toolprefix}readelf"
++ ar = "${prefix}/llvm-ar"
++ nm = "${prefix}/llvm-nm"
++ }
+
+ forward_variables_from(invoker,
+ [
diff --git a/lang/v8-beta/files/patch-build_toolchain_get__concurrent__links.py b/lang/v8-beta/files/patch-build_toolchain_get__concurrent__links.py
new file mode 100644
index 000000000000..edf94a0e06b7
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_toolchain_get__concurrent__links.py
@@ -0,0 +1,17 @@
+--- build/toolchain/get_concurrent_links.py.orig 2021-05-01 21:15:31 UTC
++++ build/toolchain/get_concurrent_links.py
+@@ -53,6 +53,14 @@ def _GetTotalMemoryInBytes():
+ return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize']))
+ except Exception:
+ return 0
++ elif sys.platform.startswith('freebsd'):
++ try:
++ avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.physmem']))
++ # With -fuse-lld it doesn't take a lot of ram, feel free to change that
++ # 1 * ... to needed amount
++ return max(1, avail_bytes / (1 * (2 ** 30))) # total / 4GB
++ except Exception:
++ return 1
+ # TODO(scottmg): Implement this for other platforms.
+ return 0
+
diff --git a/lang/v8-beta/files/patch-build_toolchain_linux_BUILD.gn b/lang/v8-beta/files/patch-build_toolchain_linux_BUILD.gn
new file mode 100644
index 000000000000..08d5cf924d40
--- /dev/null
+++ b/lang/v8-beta/files/patch-build_toolchain_linux_BUILD.gn
@@ -0,0 +1,10 @@
+--- build/toolchain/linux/BUILD.gn.orig 2021-05-01 21:15:31 UTC
++++ build/toolchain/linux/BUILD.gn
+@@ -23,7 +23,6 @@ clang_toolchain("clang_arm") {
+ }
+
+ clang_toolchain("clang_arm64") {
+- toolprefix = "aarch64-linux-gnu-"
+ toolchain_args = {
+ current_cpu = "arm64"
+ current_os = "linux"
diff --git a/lang/v8-beta/files/patch-buildtools_third__party_libc++_BUILD.gn b/lang/v8-beta/files/patch-buildtools_third__party_libc++_BUILD.gn
new file mode 100644
index 000000000000..da2a4bc2e17a
--- /dev/null
+++ b/lang/v8-beta/files/patch-buildtools_third__party_libc++_BUILD.gn
@@ -0,0 +1,10 @@
+--- buildtools/third_party/libc++/BUILD.gn.orig 2021-09-19 10:01:13 UTC
++++ buildtools/third_party/libc++/BUILD.gn
+@@ -23,6 +23,7 @@ config("config") {
+ cflags += [
+ "-fPIC",
+ "-std=c++17",
++ "-I%%LOCALBASE%%/include",
+ ]
+ }
+ }
diff --git a/lang/v8-beta/files/patch-include_v8config.h b/lang/v8-beta/files/patch-include_v8config.h
new file mode 100644
index 000000000000..2a1c5e2972e9
--- /dev/null
+++ b/lang/v8-beta/files/patch-include_v8config.h
@@ -0,0 +1,21 @@
+--- include/v8config.h.orig 2021-10-06 18:22:58 UTC
++++ include/v8config.h
+@@ -338,7 +338,18 @@ path. Add it with -I<path> to the command line
+
+ # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
+
++// Work around Clang bug present in 9.0.1, at least.
++//
++// Clang stores alignment as a 32-bit unsigned integer, but V8 only uses
++// V8_ASSUME_ALIGNED() for a 4GB (2^32) alignment
++// (kPtrComprIsolateRootAlignment). As such, the alignment overflows and
++// becomes zero, triggering an internal Clang assertion that alignment must not
++// be zero.
++#if 0
+ # define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
++#else
++# define V8_HAS_BUILTIN_ASSUME_ALIGNED 0
++#endif
+ # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
+ # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
+ # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))
diff --git a/lang/v8-beta/files/patch-src_api_api.cc b/lang/v8-beta/files/patch-src_api_api.cc
new file mode 100644
index 000000000000..056c643b5194
--- /dev/null
+++ b/lang/v8-beta/files/patch-src_api_api.cc
@@ -0,0 +1,11 @@
+--- src/api/api.cc.orig 2021-10-06 18:22:58 UTC
++++ src/api/api.cc
+@@ -5886,7 +5886,7 @@ bool v8::V8::Initialize(const int build_config) {
+ return true;
+ }
+
+-#if V8_OS_LINUX || V8_OS_MACOSX
++#if V8_OS_LINUX || V8_OS_MACOSX || V8_OS_OPENBSD || V8_OS_FREEBSD
+ bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info,
+ void* context) {
+ #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED
diff --git a/lang/v8-beta/files/patch-src_base_cpu.cc b/lang/v8-beta/files/patch-src_base_cpu.cc
new file mode 100644
index 000000000000..edded0adef06
--- /dev/null
+++ b/lang/v8-beta/files/patch-src_base_cpu.cc
@@ -0,0 +1,18 @@
+--- src/base/cpu.cc.orig 2021-10-06 18:22:58 UTC
++++ src/base/cpu.cc
+@@ -568,6 +568,7 @@ CPU::CPU()
+
+ #if V8_OS_LINUX
+
++#if V8_OS_LINUX
+ CPUInfo cpu_info;
+
+ // Extract implementor from the "CPU implementer" field.
+@@ -601,6 +602,7 @@ CPU::CPU()
+ }
+ delete[] part;
+ }
++#endif
+
+ // Extract architecture from the "CPU Architecture" field.
+ // The list is well-known, unlike the the output of
diff --git a/lang/v8-beta/files/patch-src_base_platform_platform-freebsd.cc b/lang/v8-beta/files/patch-src_base_platform_platform-freebsd.cc
new file mode 100644
index 000000000000..0af7a6ed208b
--- /dev/null
+++ b/lang/v8-beta/files/patch-src_base_platform_platform-freebsd.cc
@@ -0,0 +1,13 @@
+--- src/base/platform/platform-freebsd.cc.orig 2021-04-22 15:00:28 UTC
++++ src/base/platform/platform-freebsd.cc
+@@ -82,8 +82,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib
+ lib_name = std::string(path);
+ }
+ result.push_back(SharedLibraryAddress(
+- lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
+- reinterpret_cast<uintptr_t>(map->kve_end)));
++ lib_name, static_cast<uintptr_t>(map->kve_start),
++ static_cast<uintptr_t>(map->kve_end)));
+ }
+
+ start += ssize;
diff --git a/lang/v8-beta/files/patch-src_base_platform_platform-posix.cc b/lang/v8-beta/files/patch-src_base_platform_platform-posix.cc
new file mode 100644
index 000000000000..df2cb6eb4180
--- /dev/null
+++ b/lang/v8-beta/files/patch-src_base_platform_platform-posix.cc
@@ -0,0 +1,24 @@
+--- src/base/platform/platform-posix.cc.orig 2021-10-06 18:22:58 UTC
++++ src/base/platform/platform-posix.cc
+@@ -493,7 +493,7 @@ bool OS::DiscardSystemPages(void* address, size_t size
+
+ // static
+ bool OS::HasLazyCommits() {
+-#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX
++#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX || V8_OS_FREEBSD
+ return true;
+ #else
+ // TODO(bbudge) Return true for all POSIX platforms.
+@@ -626,6 +626,12 @@ int OS::GetCurrentThreadId() {
+ return static_cast<int>(syscall(__NR_gettid));
+ #elif V8_OS_ANDROID
+ return static_cast<int>(gettid());
++#elif V8_OS_DRAGONFLYBSD || defined(__DragonFly__)
++ return static_cast<int>(lwp_gettid());
++#elif V8_OS_FREEBSD
++ return static_cast<int>(pthread_getthreadid_np());
++#elif V8_OS_NETBSD
++ return static_cast<int>(_lwp_self());
+ #elif V8_OS_AIX
+ return static_cast<int>(thread_self());
+ #elif V8_OS_FUCHSIA
diff --git a/lang/v8-beta/files/patch-src_d8_d8-posix.cc b/lang/v8-beta/files/patch-src_d8_d8-posix.cc
new file mode 100644
index 000000000000..e76ba72218e9
--- /dev/null
+++ b/lang/v8-beta/files/patch-src_d8_d8-posix.cc
@@ -0,0 +1,19 @@
+--- src/d8/d8-posix.cc.orig 2020-06-13 18:02:18 UTC
++++ src/d8/d8-posix.cc
+@@ -4,6 +4,8 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#include <sys/types.h>
++#include <netinet/in.h>
+ #include <netinet/ip.h>
+ #include <signal.h>
+ #include <stdlib.h>
+@@ -12,7 +14,6 @@
*** 265 LINES SKIPPED ***