aboutsummaryrefslogtreecommitdiff
path: root/lang/v8
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2020-11-20 10:41:13 +0000
committerMikael Urankar <mikael@FreeBSD.org>2020-11-20 10:41:13 +0000
commit9a4ce488e85c4b59c1d2acdfd23cb88b7e9ca198 (patch)
tree84f3b4638ccf347ba91572ef9f96440521ed236f /lang/v8
parentc595b90c8246c8d8c881252dca92bf3a360aa2e6 (diff)
downloadports-9a4ce488e85c4b59c1d2acdfd23cb88b7e9ca198.tar.gz
ports-9a4ce488e85c4b59c1d2acdfd23cb88b7e9ca198.zip
lang/v8: Update to 8.7.220.23
PR: 213202 Reported by: many Approved by: sunpoet (maintainer timeout)
Notes
Notes: svn path=/head/; revision=555754
Diffstat (limited to 'lang/v8')
-rw-r--r--lang/v8/Makefile219
-rw-r--r--lang/v8/distinfo19
-rw-r--r--lang/v8/files/extra-patch-src-stub-cache.cc11
-rw-r--r--lang/v8/files/extrapatch-clang1013
-rw-r--r--lang/v8/files/patch-CVE-2015-538095
-rw-r--r--lang/v8/files/patch-build_config_BUILD.gn30
-rw-r--r--lang/v8/files/patch-build_config_BUILDCONFIG.gn48
-rw-r--r--lang/v8/files/patch-build_config_compiler_BUILD.gn92
-rw-r--r--lang/v8/files/patch-build_config_compiler_compiler.gni11
-rw-r--r--lang/v8/files/patch-build_config_features.gni11
-rw-r--r--lang/v8/files/patch-build_config_freetype_freetype.gni9
-rw-r--r--lang/v8/files/patch-build_config_linux_BUILD.gn11
-rw-r--r--lang/v8/files/patch-build_config_linux_pkg-config.py26
-rw-r--r--lang/v8/files/patch-build_config_sysroot.gni14
-rw-r--r--lang/v8/files/patch-build_detect__host__arch.py11
-rw-r--r--lang/v8/files/patch-build_gn__run__binary.py11
-rw-r--r--lang/v8/files/patch-build_linux_chrome.map29
-rw-r--r--lang/v8/files/patch-build_linux_libpci_BUILD.gn53
-rw-r--r--lang/v8/files/patch-build_linux_unbundle_libusb.gn27
-rw-r--r--lang/v8/files/patch-build_linux_unbundle_replace__gn__files.py10
-rw-r--r--lang/v8/files/patch-build_toolchain_gcc__toolchain.gni45
-rw-r--r--lang/v8/files/patch-build_toolchain_get__concurrent__links.py17
-rw-r--r--lang/v8/files/patch-build_toolchain_linux_BUILD.gn10
-rw-r--r--lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn11
-rw-r--r--lang/v8/files/patch-src-checks.h11
-rw-r--r--lang/v8/files/patch-src-deoptimizer.cc29
-rw-r--r--lang/v8/files/patch-src-ia32-code-stubs-ia32.cc11
-rw-r--r--lang/v8/files/patch-src-ia32-disasm-ia32.cc11
-rw-r--r--lang/v8/files/patch-src-ia32-ic-ia32.cc12
-rw-r--r--lang/v8/files/patch-src-liveedit.cc11
-rw-r--r--lang/v8/files/patch-src-objects.h22
-rw-r--r--lang/v8/files/patch-src-x64-disasm-x64.cc11
-rw-r--r--lang/v8/files/patch-src-x64-ic-x64.cc12
-rw-r--r--lang/v8/files/patch-src_d8_d8-posix.cc19
-rw-r--r--lang/v8/files/patch-v8_BUILD.gn32
-rw-r--r--lang/v8/files/patch-v8_include_v8config.h21
-rw-r--r--lang/v8/files/patch-v8_src_api_api.cc11
-rw-r--r--lang/v8/files/patch-v8_src_base_cpu.cc18
-rw-r--r--lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc13
-rw-r--r--lang/v8/files/patch-v8_src_base_platform_platform-posix.cc24
-rw-r--r--lang/v8/files/v8.pc11
-rw-r--r--lang/v8/files/v8_libbase.pc10
-rw-r--r--lang/v8/files/v8_libplatform.pc10
-rw-r--r--lang/v8/pkg-plist56
44 files changed, 897 insertions, 291 deletions
diff --git a/lang/v8/Makefile b/lang/v8/Makefile
index 0169e186ff23..d19911156c26 100644
--- a/lang/v8/Makefile
+++ b/lang/v8/Makefile
@@ -1,67 +1,190 @@
-# Created by: siasia
# $FreeBSD$
+# To update the port:
+# The stable v8 version follows the chromium browser
+# https://chromereleases.googleblog.com/search/label/Desktop%20Update
+# search for "The stable channel has been updated to" XX.X.XXXX.XXX
+# -> https://github.com/chromium/chromium/blob/87.0.4280.60/DEPS
+# -> 'v8_revision': 'd2fef9fb0ac356d6cf6759f29e2b56ebea8bc58d'
+# https://github.com/v8/v8/commit/d2fef9fb0ac356d6cf6759f29e2b56ebea8bc58d
+# -> Version 8.7.220.23
+# then:
+# - make makesum
+# - update the various hashes (BUILD_HASH...), see below:
+# egrep "build.git|buildtools.git|clang.git|common.git|googletest.git|icu.git|zlib.git" ${WRKSRC}/DEPS
+# - make MAINTAINER_MODE=yes fetch (warning, it'll try to upload them on my account on freefall)
+# - make makesum (to update the various deps hashes)
+# - make clean ; make (and fix the patches if needed)
+
PORTNAME= v8
-PORTVERSION= 3.18.5
-PORTREVISION= 8
+DISTVERSION= 8.7.220.23
CATEGORIES= lang
-MASTER_SITES= LOCAL/vanilla
+MASTER_SITES= LOCAL/mikael/v8/:build \
+ LOCAL/mikael/v8/:buildtools \
+ LOCAL/mikael/v8/:clang \
+ LOCAL/mikael/v8/:common \
+ LOCAL/mikael/v8/:googletest \
+ LOCAL/mikael/v8/:icu \
+ LOCAL/mikael/v8/:zlib
+DISTFILES= build-${BUILD_HASH}.tar.gz:build \
+ buildtools-${BUILDTOOLS_HASH}.tar.gz:buildtools \
+ clang-${CLANG_HASH}.tar.gz:clang \
+ common-${COMMON_HASH}.tar.gz:common \
+ googletest-${GOOGLETEST_HASH}.tar.gz:googletest \
+ icu-${ICU_HASH}.tar.gz:icu \
+ zlib-${ZLIB_HASH}.tar.gz:zlib
+EXTRACT_ONLY= ${DISTNAME}.tar.gz
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Open source JavaScript engine by Google
LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
-CONFLICTS_INSTALL= v8-devel-[0-9]*
+BUILD_DEPENDS= binutils>0:devel/binutils \
+ gn:devel/gn \
+ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \
+ libunwind>0:devel/libunwind
+LIB_DEPENDS= libicudata.so:devel/icu
-ONLY_FOR_ARCHS= i386 amd64
+.include <bsd.port.options.mk>
-PORTSCOUT= limit:^3.18.*
+# clang10+ is required, this conditionnal can be dropped when 12.1 is EOL
+.if ${OSVERSION} >= 1200000 && ${OSVERSION} < 1201515
+BUILD_DEPENDS+= llvm10>0:devel/llvm10
+.endif
-ALL_TARGET= native
-MAKE_ARGS= library=shared
-MAKE_ENV= CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX}
+USES= pkgconfig ninja python:3.5+,build tar:xz
+USE_GITHUB= yes
USE_LDCONFIG= yes
-USES= alias compiler cpe gmake python:2.7 shebangfix tar:xz
-
-CPE_VENDOR= google
-
-SHEBANG_FILES= build/gyp/gyp
-
-.include <bsd.port.pre.mk>
-
-.if ${COMPILER_TYPE} == clang
-CXXFLAGS+= -Wno-nested-anon-types -Wno-unused-function -Wno-unused-private-field
-MAKE_ENV+= LINK=clang++
-.if ${COMPILER_VERSION} >= 34
-CXXFLAGS+= -Wno-unused-const-variable
-.if ${COMPILER_VERSION} >= 35
-CXXFLAGS+= -Wno-tautological-undefined-compare
-.if ${COMPILER_VERSION} >= 36
-CXXFLAGS+= -Wno-unused-local-typedef
-.if ${COMPILER_VERSION} >= 60
-CXXFLAGS+= -Wno-null-pointer-arithmetic -Wno-vexing-parse
-EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-stub-cache.cc
-.endif
-.endif
-.endif
-.endif
-.else
-MAKE_ARGS+= strictaliasing=off
-USE_GCC= any
-.endif
+USE_GNOME= glib20
+
+# new release every minutes
+PORTSCOUT= ignore
+
+# egrep "build.git|buildtools.git|clang.git|common.git|googletest.git|icu.git|zlib.git" ${WRKSRC}/DEPS
+BUILD_HASH= 38a49c12ded01dd8c4628b432cb7eebfb29e77f1
+BUILDTOOLS_HASH= 3ff4f5027b4b81a6c9c36d64d71444f2709a4896
+CLANG_HASH= 3017edade60658a699be776d9e282509a902ffe9
+COMMON_HASH= 23ef5333a357fc7314630ef88b44c3a545881dee
+GOOGLETEST_HASH= 4fe018038f87675c083d0cfb6a6b57c274fb1753
+ICU_HASH= aef20f06d47ba76fdf13abcdb033e2a408b5a94d
+ZLIB_HASH= 4668feaaa47973a6f9d9f9caeb14cd03731854f1
+
+BUILDTYPE= Release
+
+BINARY_ALIAS= python=${PYTHON_CMD}
+
+# Run "gn args out/Release --list" 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 \
+ is_clang=true \
+ treat_warnings_as_errors=false \
+ use_aura=true \
+ use_lld=true \
+ use_custom_libcxx=false \
+ v8_use_external_startup_data=false \
+ extra_cxxflags="${CXXFLAGS}" \
+ extra_ldflags="${LDFLAGS}"
+
+MAKE_ARGS= -C out/${BUILDTYPE}
+
+# sha256 changes everytime you download the archive, need to host them on
+# freefall
+# To download distfiles : as sunpoet: make MAINTAINER_MODE=yes fetch
+.if defined(MAINTAINER_MODE)
+do-fetch:
+ ${FETCH_CMD} -o ${DISTDIR}/build-${BUILD_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/src/build.git/+archive/${BUILD_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/buildtools-${BUILDTOOLS_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/src/buildtools.git/+archive/${BUILDTOOLS_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/clang-${CLANG_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/src/tools/clang.git/+archive/${CLANG_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/common-${COMMON_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/src/base/trace_event/common.git/+archive/${COMMON_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/googletest-${GOOGLETEST_HASH}.tar.gz \
+ https://chromium.googlesource.com/external/github.com/google/googletest.git/+archive/${GOOGLETEST_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/icu-${ICU_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/deps/icu.git/+archive/${ICU_HASH}.tar.gz
+ ${FETCH_CMD} -o ${DISTDIR}/zlib-${ZLIB_HASH}.tar.gz \
+ https://chromium.googlesource.com/chromium/src/third_party/zlib.git/+archive/${ZLIB_HASH}.tar.gz
+
+. if ${USER} == ${MAINTAINER:C/@.*//}
+. for f in build-${BUILD_HASH} buildtools-${BUILDTOOLS_HASH} \
+ clang-${CLANG_HASH} common-${COMMON_HASH} \
+ googletest-${GOOGLETEST_HASH} icu-${ICU_HASH} \
+ zlib-${ZLIB_HASH}
+ scp ${DISTDIR}/${f}.tar.gz \
+ sunpoet@freefall.freebsd.org:public_distfiles/v8
+. endfor
+. endif
+.endif # defined(MAINTAINER_MODE)
+
+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}/build-${BUILD_HASH}.tar.gz -C ${WRKSRC}/build
+ ${TAR} -xf ${DISTDIR}/buildtools-${BUILDTOOLS_HASH}.tar.gz -C ${WRKSRC}/buildtools
+ ${TAR} -xf ${DISTDIR}/clang-${CLANG_HASH}.tar.gz -C ${WRKSRC}/tools/clang
+ ${TAR} -xf ${DISTDIR}/common-${COMMON_HASH}.tar.gz -C ${WRKSRC}/base/trace_event/common
+ ${TAR} -xf ${DISTDIR}/googletest-${GOOGLETEST_HASH}.tar.gz -C ${WRKSRC}/third_party/googletest/src
+ ${TAR} -xf ${DISTDIR}/icu-${ICU_HASH}.tar.gz -C ${WRKSRC}/third_party/icu
+ ${TAR} -xf ${DISTDIR}/zlib-${ZLIB_HASH}.tar.gz -C ${WRKSRC}/third_party/zlib
post-patch:
- @${REINPLACE_CMD} -e 's|test/cctest/cctest.gyp||' ${WRKSRC}/Makefile
- @${REINPLACE_CMD} -e '/test\/cctest\/cctest.gyp/d' ${WRKSRC}/build/all.gyp
- @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/build/common.gypi ${WRKSRC}/tools/gyp/v8.gyp
- @${REINPLACE_CMD} -e 's, | MAP_NORESERVE,,' ${WRKSRC}/src/platform-freebsd.cc
- @${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' ${WRKSRC}/tools/gyp/v8.gyp
+ ${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \
+ ${WRKSRC}/build/toolchain/gcc_toolchain.gni \
+ ${WRKSRC}/buildtools/third_party/libc++/BUILD.gn
+# clang10+ is required, this conditionnal can be dropped when 12.1 is EOL
+.if ${OSVERSION} >= 1200000 && ${OSVERSION} < 1201515
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-clang10
+.endif
+
+# google sucks, this file is needed but absent in the build* archive
+# https://github.com/klzgrad/naiveproxy/blob/master/src/build/config/gclient_args.gni
+ ${TOUCH} ${WRKSRC}/build/config/gclient_args.gni
+ ${ECHO} "checkout_google_benchmark = false" >> ${WRKSRC}/build/config/gclient_args.gni
+
+pre-configure:
+ # use system libraries for ICU
+ cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
+ ./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ icu || ${FALSE}
+ # google build system is too stupid to create needed directory and
+ # use system headers for ICU
+ ${MKDIR} ${WRKSRC}/out/${BUILDTYPE}/gen/shim_headers/icuuc_shim/third_party/icu/source/common/unicode \
+ ${WRKSRC}/out/${BUILDTYPE}/gen/shim_headers/icui18n_shim/third_party/icu/source/i18n/unicode \
+ ${WRKSRC}/out/${BUILDTYPE}/gen/include
+ ${CP} -R ${LOCALBASE}/include/unicode ${WRKSRC}/out/${BUILDTYPE}/gen/include
+
+do-configure:
+ cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} gn gen out/${BUILDTYPE} --args='${GN_ARGS}'
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/out/native/d8 ${STAGEDIR}${PREFIX}/bin/d8
- cd ${WRKSRC}/include/ && ${INSTALL_DATA} *.h ${STAGEDIR}${PREFIX}/include/
- ${INSTALL_LIB} ${WRKSRC}/out/native/lib.target/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so.1
- ${LN} -fs ${PREFIX}/lib/libv8.so.1 ${STAGEDIR}${PREFIX}/lib/libv8.so
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/d8 ${STAGEDIR}${PREFIX}/bin/d8
+# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/d8 ${STAGEDIR}${PREFIX}/bin/cctest
+# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/mksnapshot ${STAGEDIR}${PREFIX}/bin/mksnapshot
+# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/mkgrokdump ${STAGEDIR}${PREFIX}/bin/mkgrokdump
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8_libbase.so ${STAGEDIR}${PREFIX}/lib/libv8_libbase.so
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8_libplatform.so ${STAGEDIR}${PREFIX}/lib/libv8_libplatform.so
+ ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libchrome_zlib.so ${STAGEDIR}${PREFIX}/lib/libchrome_zlib.so
+
+ ${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/
+ ${MKDIR} ${STAGEDIR}${PREFIX}/include/libplatform \
+ ${STAGEDIR}${PREFIX}/include/cppgc
+ ${INSTALL_DATA} ${WRKSRC}/include/libplatform/*.h ${STAGEDIR}${PREFIX}/include/libplatform/
+ cd ${WRKSRC}/include/cppgc && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/cppgc " -name *\.h"
+ ${INSTALL_DATA} ${FILESDIR}/*.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
+ ${REINPLACE_CMD} "s|%%PREFIX%%|${PREFIX}|" \
+ ${STAGEDIR}${PREFIX}/libdata/pkgconfig/*
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/lang/v8/distinfo b/lang/v8/distinfo
index 10d149d96700..5c7bf03541dd 100644
--- a/lang/v8/distinfo
+++ b/lang/v8/distinfo
@@ -1,2 +1,17 @@
-SHA256 (v8-3.18.5.tar.xz) = badfa55867887e4fef68161dc877aac5e9d19c6dddb7e96b8d6f7084de711b71
-SIZE (v8-3.18.5.tar.xz) = 8727400
+TIMESTAMP = 1605533489
+SHA256 (build-38a49c12ded01dd8c4628b432cb7eebfb29e77f1.tar.gz) = 9101b1fdbbfe46daa6b73bc9d2bcb06530791b1c11862207aebe25b368cb4634
+SIZE (build-38a49c12ded01dd8c4628b432cb7eebfb29e77f1.tar.gz) = 1240608
+SHA256 (buildtools-3ff4f5027b4b81a6c9c36d64d71444f2709a4896.tar.gz) = c6c910d9c8ccaaf5ffa942c7eef9611db08aaead17dee6bacf3635c7d3bd966e
+SIZE (buildtools-3ff4f5027b4b81a6c9c36d64d71444f2709a4896.tar.gz) = 86341
+SHA256 (clang-3017edade60658a699be776d9e282509a902ffe9.tar.gz) = 68c0b692589f838f22b6d1588b121d0ab556b13d6d24d029856a292b07d77eb0
+SIZE (clang-3017edade60658a699be776d9e282509a902ffe9.tar.gz) = 264892
+SHA256 (common-23ef5333a357fc7314630ef88b44c3a545881dee.tar.gz) = f9ffda89fbdb21ace09ac308cf396bb57bdbcc65e41d298be0fa71df95611cd9
+SIZE (common-23ef5333a357fc7314630ef88b44c3a545881dee.tar.gz) = 9982
+SHA256 (googletest-4fe018038f87675c083d0cfb6a6b57c274fb1753.tar.gz) = 5c3d94f5c4b636b343e4d0e5f7d6885927cbc46cdc3063b8ed94e18c00d55072
+SIZE (googletest-4fe018038f87675c083d0cfb6a6b57c274fb1753.tar.gz) = 863456
+SHA256 (icu-aef20f06d47ba76fdf13abcdb033e2a408b5a94d.tar.gz) = 065544e46981968793737abe35a7de0d651a6a017be60fb778a7ab7bcb915645
+SIZE (icu-aef20f06d47ba76fdf13abcdb033e2a408b5a94d.tar.gz) = 43355045
+SHA256 (zlib-4668feaaa47973a6f9d9f9caeb14cd03731854f1.tar.gz) = 14093560cb4bf089704b78f7976f7b86b68bdbe49b1fe79e62feb373a542609a
+SIZE (zlib-4668feaaa47973a6f9d9f9caeb14cd03731854f1.tar.gz) = 306550
+SHA256 (v8-v8-8.7.220.23_GH0.tar.gz) = 7c8da23593d815ef3b043976897b22821adca6ca5a925fdde34f33e8eb90f5b5
+SIZE (v8-v8-8.7.220.23_GH0.tar.gz) = 25355323
diff --git a/lang/v8/files/extra-patch-src-stub-cache.cc b/lang/v8/files/extra-patch-src-stub-cache.cc
deleted file mode 100644
index 2e2a2a5427a5..000000000000
--- a/lang/v8/files/extra-patch-src-stub-cache.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/stub-cache.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/stub-cache.cc
-@@ -1474,7 +1474,7 @@ Handle<Code> StubCompiler::GetCodeWithFl
- Handle<Name> name) {
- return (FLAG_print_code_stubs && !name.is_null() && name->IsString())
- ? GetCodeWithFlags(flags, *Handle<String>::cast(name)->ToCString())
-- : GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL));
-+ : GetCodeWithFlags(flags, static_cast<char*>(NULL));
- }
-
-
diff --git a/lang/v8/files/extrapatch-clang10 b/lang/v8/files/extrapatch-clang10
new file mode 100644
index 000000000000..dff0b00381e9
--- /dev/null
+++ b/lang/v8/files/extrapatch-clang10
@@ -0,0 +1,13 @@
+--- build/toolchain/gcc_toolchain.gni.orig 2020-06-30 10:30:30 UTC
++++ build/toolchain/gcc_toolchain.gni
+@@ -596,8 +596,8 @@ template("clang_toolchain") {
+ gcc_toolchain(target_name) {
+ if (is_bsd) {
+ prefix = "/usr/local/bin"
+- cc = "cc"
+- cxx = "c++"
++ cc = "clang10"
++ cxx = "clang++10"
+ ld = cxx
+ readelf = "readelf"
+ ar = "${prefix}/ar"
diff --git a/lang/v8/files/patch-CVE-2015-5380 b/lang/v8/files/patch-CVE-2015-5380
deleted file mode 100644
index 78293cff9f37..000000000000
--- a/lang/v8/files/patch-CVE-2015-5380
+++ /dev/null
@@ -1,95 +0,0 @@
-Backport of fix found here:
-https://github.com/joyent/node/commit/78b0e30954111cfaba0edbeee85450d8cbc6fdf6
-
-Note, this patch is modified to use ASSERT instead of DCHECK because
-this version of node is from before the rename which happened here:
-https://codereview.chromium.org/430503007
-
---- src/unicode-inl.h.orig 2013-05-01 12:56:29 UTC
-+++ src/unicode-inl.h
-@@ -168,6 +168,7 @@ unsigned Utf8::Length(uchar c, int previ
-
- Utf8DecoderBase::Utf8DecoderBase()
- : unbuffered_start_(NULL),
-+ unbuffered_length_(0),
- utf16_length_(0),
- last_byte_of_buffer_unused_(false) {}
-
-@@ -207,8 +208,7 @@ unsigned Utf8Decoder<kBufferSize>::Write
- if (length <= buffer_length) return length;
- ASSERT(unbuffered_start_ != NULL);
- // Copy the rest the slow way.
-- WriteUtf16Slow(unbuffered_start_,
-- data + buffer_length,
-+ WriteUtf16Slow(unbuffered_start_, unbuffered_length_, data + buffer_length,
- length - buffer_length);
- return length;
- }
---- src/unicode.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/unicode.cc
-@@ -284,6 +284,7 @@ void Utf8DecoderBase::Reset(uint16_t* bu
- // Assume everything will fit in the buffer and stream won't be needed.
- last_byte_of_buffer_unused_ = false;
- unbuffered_start_ = NULL;
-+ unbuffered_length_ = 0;
- bool writing_to_buffer = true;
- // Loop until stream is read, writing to buffer as long as buffer has space.
- unsigned utf16_length = 0;
-@@ -310,6 +311,7 @@ void Utf8DecoderBase::Reset(uint16_t* bu
- // Just wrote last character of buffer
- writing_to_buffer = false;
- unbuffered_start_ = stream;
-+ unbuffered_length_ = stream_length;
- }
- continue;
- }
-@@ -319,20 +321,24 @@ void Utf8DecoderBase::Reset(uint16_t* bu
- writing_to_buffer = false;
- last_byte_of_buffer_unused_ = true;
- unbuffered_start_ = stream - cursor;
-+ unbuffered_length_ = stream_length + cursor;
- }
- utf16_length_ = utf16_length;
- }
-
-
- void Utf8DecoderBase::WriteUtf16Slow(const uint8_t* stream,
-+ unsigned stream_length,
- uint16_t* data,
- unsigned data_length) {
- while (data_length != 0) {
- unsigned cursor = 0;
-- uint32_t character = Utf8::ValueOf(stream, Utf8::kMaxEncodedSize, &cursor);
-+
-+ uint32_t character = Utf8::ValueOf(stream, stream_length, &cursor);
- // There's a total lack of bounds checking for stream
- // as it was already done in Reset.
- stream += cursor;
-+ stream_length -= cursor;
- if (character > unibrow::Utf16::kMaxNonSurrogateCharCode) {
- *data++ = Utf16::LeadSurrogate(character);
- *data++ = Utf16::TrailSurrogate(character);
-@@ -343,6 +349,7 @@ void Utf8DecoderBase::WriteUtf16Slow(con
- data_length -= 1;
- }
- }
-+ ASSERT(stream_length >= 0);
- }
-
-
---- src/unicode.h.orig 2013-05-01 12:56:29 UTC
-+++ src/unicode.h
-@@ -184,10 +184,10 @@ class Utf8DecoderBase {
- unsigned buffer_length,
- const uint8_t* stream,
- unsigned stream_length);
-- static void WriteUtf16Slow(const uint8_t* stream,
-- uint16_t* data,
-- unsigned length);
-+ static void WriteUtf16Slow(const uint8_t* stream, unsigned stream_length,
-+ uint16_t* data, unsigned length);
- const uint8_t* unbuffered_start_;
-+ unsigned unbuffered_length_;
- unsigned utf16_length_;
- bool last_byte_of_buffer_unused_;
- private:
diff --git a/lang/v8/files/patch-build_config_BUILD.gn b/lang/v8/files/patch-build_config_BUILD.gn
new file mode 100644
index 000000000000..964e6821a3a3
--- /dev/null
+++ b/lang/v8/files/patch-build_config_BUILD.gn
@@ -0,0 +1,30 @@
+--- build/config/BUILD.gn.orig 2020-09-19 19:50:44 UTC
++++ build/config/BUILD.gn
+@@ -133,7 +133,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" && enable_iterator_debugging) {
++ } 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 .
+ # TODO(phajdan.jr): Should we enable this for all of POSIX?
+@@ -231,9 +231,7 @@ config("default_libs") {
+ ]
+ } else if (is_linux || is_chromeos) {
+ libs = [
+- "dl",
+ "pthread",
+- "rt",
+ ]
+ }
+ }
+@@ -316,7 +314,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/files/patch-build_config_BUILDCONFIG.gn b/lang/v8/files/patch-build_config_BUILDCONFIG.gn
new file mode 100644
index 000000000000..d06fbd3ddec1
--- /dev/null
+++ b/lang/v8/files/patch-build_config_BUILDCONFIG.gn
@@ -0,0 +1,48 @@
+--- build/config/BUILDCONFIG.gn.orig 2020-11-16 14:30:51 UTC
++++ build/config/BUILDCONFIG.gn
+@@ -131,10 +131,10 @@ declare_args() {
+ is_official_build = false
+
+ # Whether we're a traditional desktop unix.
+- is_desktop_linux = current_os == "linux"
++ is_desktop_linux = current_os == "linux" || current_os == "freebsd"
+
+ # 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")
+@@ -186,8 +186,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"
+@@ -224,7 +224,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"
+@@ -288,10 +288,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/files/patch-build_config_compiler_BUILD.gn b/lang/v8/files/patch-build_config_compiler_BUILD.gn
new file mode 100644
index 000000000000..35cd606c4e03
--- /dev/null
+++ b/lang/v8/files/patch-build_config_compiler_BUILD.gn
@@ -0,0 +1,92 @@
+--- build/config/compiler/BUILD.gn.orig 2020-11-16 14:30:51 UTC
++++ build/config/compiler/BUILD.gn
+@@ -128,7 +128,7 @@ declare_args() {
+ #
+ # TODO(crbug.com/977230): Enabling this when 'use_xcode_clang' is true may
+ # call an old clang that doesn't support auto-init.
+- init_stack_vars = !is_android && !use_xcode_clang
++ init_stack_vars = !is_android && !use_xcode_clang && !is_bsd
+
+ # This argument is to control whether enabling text section splitting in the
+ # final binary. When enabled, the separated text sections with prefix
+@@ -291,7 +291,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 &&
+@@ -389,7 +389,7 @@ config("compiler") {
+
+ # Compiler instrumentation can introduce dependencies in DSOs to symbols in
+ # the executable they are loaded into, so they are unresolved at link-time.
+- if (!using_sanitizer) {
++ if (!using_sanitizer && !is_bsd) {
+ ldflags += [
+ "-Wl,-z,defs",
+ "-Wl,--as-needed",
+@@ -480,7 +480,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 ]
+
+ cflags += [
+@@ -776,7 +776,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" ]
+ }
+@@ -1129,7 +1129,7 @@ config("compiler_deterministic") {
+ "-Xclang",
+ ".",
+ ]
+- 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,." ]
+ }
+@@ -1512,7 +1512,7 @@ config("default_warnings") {
+ cflags += [ "-Wno-nonportable-include-path" ]
+ }
+
+- if (current_toolchain == host_toolchain || !use_xcode_clang) {
++ if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
+ # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
+ # recognize.
+ cflags += [
+@@ -1764,7 +1764,7 @@ config("thin_archive") {
+ # Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't
+ # have a "thin archive" mode (it does accept -T, but it means truncating
+ # archive names to 16 characters, which is not what we want).
+- 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" ]
+@@ -2297,7 +2297,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" ]
+ }
+
+ # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
+@@ -2339,7 +2339,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.
diff --git a/lang/v8/files/patch-build_config_compiler_compiler.gni b/lang/v8/files/patch-build_config_compiler_compiler.gni
new file mode 100644
index 000000000000..1106d32da150
--- /dev/null
+++ b/lang/v8/files/patch-build_config_compiler_compiler.gni
@@ -0,0 +1,11 @@
+--- build/config/compiler/compiler.gni.orig 2020-06-13 18:27:18 UTC
++++ build/config/compiler/compiler.gni
+@@ -176,7 +176,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 &&
++ !is_bsd && !use_lld && !(is_chromecast && is_linux &&
+ (current_cpu == "arm" || current_cpu == "mipsel")) &&
+ ((is_linux && (current_cpu == "x64" || current_cpu == "x86" ||
+ current_cpu == "arm" || current_cpu == "arm64" ||
diff --git a/lang/v8/files/patch-build_config_features.gni b/lang/v8/files/patch-build_config_features.gni
new file mode 100644
index 000000000000..4469d4f06273
--- /dev/null
+++ b/lang/v8/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/files/patch-build_config_freetype_freetype.gni b/lang/v8/files/patch-build_config_freetype_freetype.gni
new file mode 100644
index 000000000000..17bed01510f8
--- /dev/null
+++ b/lang/v8/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/files/patch-build_config_linux_BUILD.gn b/lang/v8/files/patch-build_config_linux_BUILD.gn
new file mode 100644
index 000000000000..e1ce0cbb1905
--- /dev/null
+++ b/lang/v8/files/patch-build_config_linux_BUILD.gn
@@ -0,0 +1,11 @@
+--- build/config/linux/BUILD.gn.orig 2020-05-13 18:39:36 UTC
++++ build/config/linux/BUILD.gn
+@@ -30,7 +30,7 @@ config("runtime_library") {
+
+ if ((!(is_chromeos || chromeos_is_browser_only) ||
+ 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/files/patch-build_config_linux_pkg-config.py b/lang/v8/files/patch-build_config_linux_pkg-config.py
new file mode 100644
index 000000000000..8a2865a024c0
--- /dev/null
+++ b/lang/v8/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/files/patch-build_config_sysroot.gni b/lang/v8/files/patch-build_config_sysroot.gni
new file mode 100644
index 000000000000..8b68404769fb
--- /dev/null
+++ b/lang/v8/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/files/patch-build_detect__host__arch.py b/lang/v8/files/patch-build_detect__host__arch.py
new file mode 100644
index 000000000000..588896662607
--- /dev/null
+++ b/lang/v8/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/files/patch-build_gn__run__binary.py b/lang/v8/files/patch-build_gn__run__binary.py
new file mode 100644
index 000000000000..d9e733834b4a
--- /dev/null
+++ b/lang/v8/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/files/patch-build_linux_chrome.map b/lang/v8/files/patch-build_linux_chrome.map
new file mode 100644
index 000000000000..7465bc9773c5
--- /dev/null
+++ b/lang/v8/files/patch-build_linux_chrome.map
@@ -0,0 +1,29 @@
+--- build/linux/chrome.map.orig 2019-03-11 22:00:52 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;
+@@ -81,7 +88,4 @@ global:
+ localtime64;
+ localtime64_r;
+ localtime_r;
+-
+-local:
+- *;
+ };
diff --git a/lang/v8/files/patch-build_linux_libpci_BUILD.gn b/lang/v8/files/patch-build_linux_libpci_BUILD.gn
new file mode 100644
index 000000000000..86373b5ebf39
--- /dev/null
+++ b/lang/v8/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/files/patch-build_linux_unbundle_libusb.gn b/lang/v8/files/patch-build_linux_unbundle_libusb.gn
new file mode 100644
index 000000000000..1cc0b00012c6
--- /dev/null
+++ b/lang/v8/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/files/patch-build_linux_unbundle_replace__gn__files.py b/lang/v8/files/patch-build_linux_unbundle_replace__gn__files.py
new file mode 100644
index 000000000000..ca2d4fd5e12e
--- /dev/null
+++ b/lang/v8/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/files/patch-build_toolchain_gcc__toolchain.gni b/lang/v8/files/patch-build_toolchain_gcc__toolchain.gni
new file mode 100644
index 000000000000..1c051a3a9547
--- /dev/null
+++ b/lang/v8/files/patch-build_toolchain_gcc__toolchain.gni
@@ -0,0 +1,45 @@
+--- build/toolchain/gcc_toolchain.gni.orig 2020-11-16 14:30:51 UTC
++++ build/toolchain/gcc_toolchain.gni
+@@ -50,6 +50,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).
+ #
+@@ -641,13 +646,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 = "${toolprefix}nm"
++ if (is_bsd) {
++ prefix = "%%LOCALBASE%%/bin"
++ cc = "cc"
++ cxx = "c++"
++ ld = cxx
++ readelf = "readelf"
++ ar = "${prefix}/ar"
++ nm = "${toolprefix}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 = "${toolprefix}nm"
++ }
+
+ forward_variables_from(invoker,
+ [
diff --git a/lang/v8/files/patch-build_toolchain_get__concurrent__links.py b/lang/v8/files/patch-build_toolchain_get__concurrent__links.py
new file mode 100644
index 000000000000..45bc3d0a520e
--- /dev/null
+++ b/lang/v8/files/patch-build_toolchain_get__concurrent__links.py
@@ -0,0 +1,17 @@
+--- build/toolchain/get_concurrent_links.py.orig 2019-06-04 18:55:15 UTC
++++ build/toolchain/get_concurrent_links.py
+@@ -48,6 +48,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/files/patch-build_toolchain_linux_BUILD.gn b/lang/v8/files/patch-build_toolchain_linux_BUILD.gn
new file mode 100644
index 000000000000..29b9160f7b07
--- /dev/null
+++ b/lang/v8/files/patch-build_toolchain_linux_BUILD.gn
@@ -0,0 +1,10 @@
+--- build/toolchain/linux/BUILD.gn.orig 2019-04-30 22:22:28 UTC
++++ build/toolchain/linux/BUILD.gn
+@@ -22,7 +22,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/files/patch-buildtools_third__party_libc++_BUILD.gn b/lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn
new file mode 100644
index 000000000000..5de32dfc94cb
--- /dev/null
+++ b/lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn
@@ -0,0 +1,11 @@
+--- buildtools/third_party/libc++/BUILD.gn.orig 2020-07-22 17:57:09 UTC
++++ buildtools/third_party/libc++/BUILD.gn
+@@ -14,7 +14,7 @@ config("config") {
+ # its implementation.
+ cflags += [ "-Wno-macro-redefined" ]
+ } else {
+- cflags += [ "-fPIC" ]
++ cflags += [ "-fPIC", "-I%%LOCALBASE%%/include" ]
+ }
+ }
+
diff --git a/lang/v8/files/patch-src-checks.h b/lang/v8/files/patch-src-checks.h
deleted file mode 100644
index 76be204b96d2..000000000000
--- a/lang/v8/files/patch-src-checks.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/checks.h.orig 2013-05-01 12:56:29 UTC
-+++ src/checks.h
-@@ -248,7 +248,7 @@ template <int> class StaticAssertionHelp
- #define STATIC_CHECK(test) \
- typedef \
- StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
-- SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
-+ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) __attribute__((__unused__))
-
-
- extern bool FLAG_enable_slow_asserts;
diff --git a/lang/v8/files/patch-src-deoptimizer.cc b/lang/v8/files/patch-src-deoptimizer.cc
deleted file mode 100644
index dc2e817a610e..000000000000
--- a/lang/v8/files/patch-src-deoptimizer.cc
+++ /dev/null
@@ -1,29 +0,0 @@
---- src/deoptimizer.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/deoptimizer.cc
-@@ -1392,7 +1392,7 @@ void Deoptimizer::MaterializeHeapObjects
- PrintF("Materializing a new heap number %p [%e] in slot %p\n",
- reinterpret_cast<void*>(*num),
- d.value(),
-- d.slot_address());
-+ reinterpret_cast<void*>(d.slot_address()));
- }
- Memory::Object_at(d.slot_address()) = *num;
- }
-@@ -1474,7 +1474,7 @@ void Deoptimizer::MaterializeHeapNumbers
- "for parameter slot #%d\n",
- reinterpret_cast<void*>(*num),
- d.value(),
-- d.slot_address(),
-+ reinterpret_cast<void*>(d.slot_address()),
- index);
- }
-
-@@ -1490,7 +1490,7 @@ void Deoptimizer::MaterializeHeapNumbers
- "for expression slot #%d\n",
- reinterpret_cast<void*>(*num),
- d.value(),
-- d.slot_address(),
-+ reinterpret_cast<void*>(d.slot_address()),
- index);
- }
-
diff --git a/lang/v8/files/patch-src-ia32-code-stubs-ia32.cc b/lang/v8/files/patch-src-ia32-code-stubs-ia32.cc
deleted file mode 100644
index 7769977b44c8..000000000000
--- a/lang/v8/files/patch-src-ia32-code-stubs-ia32.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/ia32/code-stubs-ia32.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/ia32/code-stubs-ia32.cc
-@@ -5650,7 +5650,7 @@ void StringCharFromCodeGenerator::Genera
- ASSERT(IsPowerOf2(String::kMaxOneByteCharCode + 1));
- __ test(code_,
- Immediate(kSmiTagMask |
-- ((~String::kMaxOneByteCharCode) << kSmiTagSize)));
-+ ((~String::kMaxOneByteCharCodeU) << kSmiTagSize)));
- __ j(not_zero, &slow_case_);
-
- Factory* factory = masm->isolate()->factory();
diff --git a/lang/v8/files/patch-src-ia32-disasm-ia32.cc b/lang/v8/files/patch-src-ia32-disasm-ia32.cc
deleted file mode 100644
index a82a393f2d15..000000000000
--- a/lang/v8/files/patch-src-ia32-disasm-ia32.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/ia32/disasm-ia32.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/ia32/disasm-ia32.cc
-@@ -1707,7 +1707,7 @@ int Disassembler::ConstantPoolSizeAt(byt
- buffer[0] = '\0';
- byte* prev_pc = pc;
- pc += d.InstructionDecode(buffer, pc);
-- fprintf(f, "%p", prev_pc);
-+ fprintf(f, "%p", reinterpret_cast<void*>(prev_pc));
- fprintf(f, " ");
-
- for (byte* bp = prev_pc; bp < pc; bp++) {
diff --git a/lang/v8/files/patch-src-ia32-ic-ia32.cc b/lang/v8/files/patch-src-ia32-ic-ia32.cc
deleted file mode 100644
index 1a38139abbe3..000000000000
--- a/lang/v8/files/patch-src-ia32-ic-ia32.cc
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/ia32/ic-ia32.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/ia32/ic-ia32.cc
-@@ -1657,7 +1657,8 @@ void PatchInlinedSmiCode(Address address
- int8_t delta = *reinterpret_cast<int8_t*>(delta_address);
- if (FLAG_trace_ic) {
- PrintF("[ patching ic at %p, test=%p, delta=%d\n",
-- address, test_instruction_address, delta);
-+ reinterpret_cast<void*>(address),
-+ reinterpret_cast<void*>(test_instruction_address), delta);
- }
-
- // Patch with a short conditional jump. Enabling means switching from a short
diff --git a/lang/v8/files/patch-src-liveedit.cc b/lang/v8/files/patch-src-liveedit.cc
deleted file mode 100644
index aa4d9310f462..000000000000
--- a/lang/v8/files/patch-src-liveedit.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/liveedit.cc.orig 2013-05-01 12:56:29 UTC
-+++ src/liveedit.cc
-@@ -203,7 +203,7 @@ class Differencer {
-
- static const int kDirectionSizeBits = 2;
- static const int kDirectionMask = (1 << kDirectionSizeBits) - 1;
-- static const int kEmptyCellValue = -1 << kDirectionSizeBits;
-+ static const int kEmptyCellValue = -(1 << kDirectionSizeBits);
-
- // This method only holds static assert statement (unfortunately you cannot
- // place one in class scope).
diff --git a/lang/v8/files/patch-src-objects.h b/lang/v8/files/patch-src-objects.h
deleted file mode 100644
index f6a1c20f006d..000000000000
--- a/lang/v8/files/patch-src-objects.h
+++ /dev/null
@@ -1,22 +0,0 @@
---- src/objects.h.orig 2013-05-01 12:56:29 UTC
-+++ src/objects.h
-@@ -5573,7 +5573,7 @@ class Map: public HeapObject {
- static const int kElementsKindBitCount = 5;
-
- // Derived values from bit field 2
-- static const int kElementsKindMask = (-1 << kElementsKindShift) &
-+ static const int kElementsKindMask = -(1 << kElementsKindShift) &
- ((1 << (kElementsKindShift + kElementsKindBitCount)) - 1);
- static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>(
- (FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1;
-@@ -7580,8 +7580,8 @@ class Name: public HeapObject {
- STATIC_CHECK(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength + 1));
-
- static const int kContainsCachedArrayIndexMask =
-- (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
-- kIsNotArrayIndexMask;
-+ (~static_cast<unsigned>(kMaxCachedArrayIndexLength) <<
-+ kArrayIndexHashLengthShift) | kIsNotArrayIndexMask;
-
- // Value of empty hash field indicating that the hash is not computed.
- static const int kEmptyHashField =
diff --git a/lang/v8/files/patch-src-x64-disasm-x64.cc b/lang/v8/files/patch-src-x64-disasm-x64.cc
deleted file mode 100644
index 4bcafb5bfb61..000000000000
--- a/lang/v8/files/patch-src-x64-disasm-x64.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/x64/disasm-x64.cc.orig 2013-05-01 12:56:28 UTC
-+++ src/x64/disasm-x64.cc
-@@ -1851,7 +1851,7 @@ void Disassembler::Disassemble(FILE* f,
- buffer[0] = '\0';
- byte* prev_pc = pc;
- pc += d.InstructionDecode(buffer, pc);
-- fprintf(f, "%p", prev_pc);
-+ fprintf(f, "%p", reinterpret_cast<void*>(prev_pc));
- fprintf(f, " ");
-
- for (byte* bp = prev_pc; bp < pc; bp++) {
diff --git a/lang/v8/files/patch-src-x64-ic-x64.cc b/lang/v8/files/patch-src-x64-ic-x64.cc
deleted file mode 100644
index bd10bf35ded6..000000000000
--- a/lang/v8/files/patch-src-x64-ic-x64.cc
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/x64/ic-x64.cc.orig 2013-05-01 12:56:28 UTC
-+++ src/x64/ic-x64.cc
-@@ -1672,7 +1672,8 @@ void PatchInlinedSmiCode(Address address
- int8_t delta = *reinterpret_cast<int8_t*>(delta_address);
- if (FLAG_trace_ic) {
- PrintF("[ patching ic at %p, test=%p, delta=%d\n",
-- address, test_instruction_address, delta);
-+ reinterpret_cast<void*>(address),
-+ reinterpret_cast<void*>(test_instruction_address), delta);
- }
-
- // Patch with a short conditional jump. Enabling means switching from a short
diff --git a/lang/v8/files/patch-src_d8_d8-posix.cc b/lang/v8/files/patch-src_d8_d8-posix.cc
new file mode 100644
index 000000000000..e76ba72218e9
--- /dev/null
+++ b/lang/v8/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 @@
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+-#include <sys/types.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
+
diff --git a/lang/v8/files/patch-v8_BUILD.gn b/lang/v8/files/patch-v8_BUILD.gn
new file mode 100644
index 000000000000..e0fe44d86a02
--- /dev/null
+++ b/lang/v8/files/patch-v8_BUILD.gn
@@ -0,0 +1,32 @@
+--- BUILD.gn.orig 2020-09-18 23:49:09 UTC
++++ BUILD.gn
+@@ -4069,7 +4069,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",
+@@ -4089,6 +4089,12 @@ v8_component("v8_libbase") {
+ "dl",
+ "rt",
+ ]
++ } 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 = [
+@@ -4431,6 +4437,7 @@ if (v8_monolithic) {
+ ":v8_libsampler",
+ "//build/win:default_exe_manifest",
+ ]
++ libs = ["execinfo"]
+
+ configs = [ ":internal_config" ]
+ }
diff --git a/lang/v8/files/patch-v8_include_v8config.h b/lang/v8/files/patch-v8_include_v8config.h
new file mode 100644
index 000000000000..abb2e3cc1749
--- /dev/null
+++ b/lang/v8/files/patch-v8_include_v8config.h
@@ -0,0 +1,21 @@
+--- include/v8config.h.orig 2020-03-03 18:55:34 UTC
++++ include/v8config.h
+@@ -273,7 +273,18 @@
+ # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
+ (__has_attribute(warn_unused_result))
+
++// 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/files/patch-v8_src_api_api.cc b/lang/v8/files/patch-v8_src_api_api.cc
new file mode 100644
index 000000000000..b583f93e3123
--- /dev/null
+++ b/lang/v8/files/patch-v8_src_api_api.cc
@@ -0,0 +1,11 @@
+--- src/api/api.cc.orig 2020-05-13 18:41:59 UTC
++++ src/api/api.cc
+@@ -5726,7 +5726,7 @@ bool v8::V8::Initialize() {
+ 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_TARGET_ARCH_X64 && !V8_OS_ANDROID
diff --git a/lang/v8/files/patch-v8_src_base_cpu.cc b/lang/v8/files/patch-v8_src_base_cpu.cc
new file mode 100644
index 000000000000..1ee0e5c1abcc
--- /dev/null
+++ b/lang/v8/files/patch-v8_src_base_cpu.cc
@@ -0,0 +1,18 @@
+--- src/base/cpu.cc.orig 2020-05-13 18:41:59 UTC
++++ src/base/cpu.cc
+@@ -427,6 +427,7 @@ CPU::CPU()
+
+ #if V8_OS_LINUX
+
++#if V8_OS_LINUX
+ CPUInfo cpu_info;
+
+ // Extract implementor from the "CPU implementer" field.
+@@ -460,6 +461,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/files/patch-v8_src_base_platform_platform-freebsd.cc b/lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc
new file mode 100644
index 000000000000..ed3a93e17053
--- /dev/null
+++ b/lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc
@@ -0,0 +1,13 @@
+--- src/base/platform/platform-freebsd.cc.orig 2020-05-13 18:41:59 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/files/patch-v8_src_base_platform_platform-posix.cc b/lang/v8/files/patch-v8_src_base_platform_platform-posix.cc
new file mode 100644
index 000000000000..60b6aa2f5eb4
--- /dev/null
+++ b/lang/v8/files/patch-v8_src_base_platform_platform-posix.cc
@@ -0,0 +1,24 @@
+--- src/base/platform/platform-posix.cc.orig 2020-05-13 18:41:59 UTC
++++ src/base/platform/platform-posix.cc
+@@ -433,7 +433,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.
+@@ -564,6 +564,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/files/v8.pc b/lang/v8/files/v8.pc
new file mode 100644
index 000000000000..8d9970831e04
--- /dev/null
+++ b/lang/v8/files/v8.pc
@@ -0,0 +1,11 @@
+prefix=%%PREFIX%%
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: v8
+Description: V8 JavaScript Engine
+Version: @VERSION@
+Requires: icu-uc, icu-i18n, v8_libbase = @VERSION@
+Libs: -L${libdir} -lv8 -pthread
+Cflags: -I${includedir}
diff --git a/lang/v8/files/v8_libbase.pc b/lang/v8/files/v8_libbase.pc
new file mode 100644
index 000000000000..171cd2e2112d
--- /dev/null
+++ b/lang/v8/files/v8_libbase.pc
@@ -0,0 +1,10 @@
+prefixr=%%PREFIX%%
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: v8
+Description: V8 JavaScript Engine - Base library
+Version: @VERSION@
+Libs: -L${libdir} -lv8_libbase
+Cflags: -I${includedir}
diff --git a/lang/v8/files/v8_libplatform.pc b/lang/v8/files/v8_libplatform.pc
new file mode 100644
index 000000000000..43708a89a9bd
--- /dev/null
+++ b/lang/v8/files/v8_libplatform.pc
@@ -0,0 +1,10 @@
+prefix=%%PREFIX%%
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: v8
+Description: V8 JavaScript Engine - Platform library
+Version: @VERSION@
+Libs: -L${libdir} -lv8_libplatform -pthread
+Cflags: -I${includedir}
diff --git a/lang/v8/pkg-plist b/lang/v8/pkg-plist
index 4af66611b0a9..6eea3be81c3d 100644
--- a/lang/v8/pkg-plist
+++ b/lang/v8/pkg-plist
@@ -1,9 +1,55 @@
bin/d8
-include/v8-debug.h
-include/v8-preparser.h
+include/cppgc/allocation.h
+include/cppgc/common.h
+include/cppgc/custom-space.h
+include/cppgc/default-platform.h
+include/cppgc/garbage-collected.h
+include/cppgc/heap.h
+include/cppgc/internal/api-constants.h
+include/cppgc/internal/atomic-entry-flag.h
+include/cppgc/internal/caged-heap-local-data.h
+include/cppgc/internal/compiler-specific.h
+include/cppgc/internal/finalizer-trait.h
+include/cppgc/internal/gc-info.h
+include/cppgc/internal/logging.h
+include/cppgc/internal/persistent-node.h
+include/cppgc/internal/pointer-policies.h
+include/cppgc/internal/prefinalizer-handler.h
+include/cppgc/internal/process-heap.h
+include/cppgc/internal/write-barrier.h
+include/cppgc/liveness-broker.h
+include/cppgc/macros.h
+include/cppgc/member.h
+include/cppgc/persistent.h
+include/cppgc/platform.h
+include/cppgc/prefinalizer.h
+include/cppgc/source-location.h
+include/cppgc/trace-trait.h
+include/cppgc/type-traits.h
+include/cppgc/visitor.h
+include/libplatform/libplatform-export.h
+include/libplatform/libplatform.h
+include/libplatform/v8-tracing.h
+include/v8-cppgc.h
+include/v8-fast-api-calls.h
+include/v8-inspector-protocol.h
+include/v8-inspector.h
+include/v8-internal.h
+include/v8-metrics.h
+include/v8-platform.h
include/v8-profiler.h
-include/v8-testing.h
+include/v8-util.h
+include/v8-value-serializer-version.h
+include/v8-version-string.h
+include/v8-version.h
+include/v8-wasm-trap-handler-posix.h
+include/v8-wasm-trap-handler-win.h
include/v8.h
-include/v8stdint.h
+include/v8config.h
lib/libv8.so
-lib/libv8.so.1
+lib/libv8_libbase.so
+lib/libv8_libplatform.so
+lib/libchrome_zlib.so
+libdata/pkgconfig/v8.pc
+libdata/pkgconfig/v8_libbase.pc
+libdata/pkgconfig/v8_libplatform.pc