Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 10:41:14 +0000 (UTC)
From:      Mikael Urankar <mikael@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r555754 - in head/lang/v8: . files
Message-ID:  <202011201041.0AKAfE62059601@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mikael
Date: Fri Nov 20 10:41:13 2020
New Revision: 555754
URL: https://svnweb.freebsd.org/changeset/ports/555754

Log:
  lang/v8: Update to 8.7.220.23
  
  PR:		213202
  Reported by:	many
  Approved by:	sunpoet (maintainer timeout)

Added:
  head/lang/v8/files/extrapatch-clang10   (contents, props changed)
  head/lang/v8/files/patch-build_config_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-build_config_BUILDCONFIG.gn   (contents, props changed)
  head/lang/v8/files/patch-build_config_compiler_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-build_config_compiler_compiler.gni   (contents, props changed)
  head/lang/v8/files/patch-build_config_features.gni   (contents, props changed)
  head/lang/v8/files/patch-build_config_freetype_freetype.gni   (contents, props changed)
  head/lang/v8/files/patch-build_config_linux_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-build_config_linux_pkg-config.py   (contents, props changed)
  head/lang/v8/files/patch-build_config_sysroot.gni   (contents, props changed)
  head/lang/v8/files/patch-build_detect__host__arch.py   (contents, props changed)
  head/lang/v8/files/patch-build_gn__run__binary.py   (contents, props changed)
  head/lang/v8/files/patch-build_linux_chrome.map   (contents, props changed)
  head/lang/v8/files/patch-build_linux_libpci_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-build_linux_unbundle_libusb.gn   (contents, props changed)
  head/lang/v8/files/patch-build_linux_unbundle_replace__gn__files.py   (contents, props changed)
  head/lang/v8/files/patch-build_toolchain_gcc__toolchain.gni   (contents, props changed)
  head/lang/v8/files/patch-build_toolchain_get__concurrent__links.py   (contents, props changed)
  head/lang/v8/files/patch-build_toolchain_linux_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-src_d8_d8-posix.cc   (contents, props changed)
  head/lang/v8/files/patch-v8_BUILD.gn   (contents, props changed)
  head/lang/v8/files/patch-v8_include_v8config.h   (contents, props changed)
  head/lang/v8/files/patch-v8_src_api_api.cc   (contents, props changed)
  head/lang/v8/files/patch-v8_src_base_cpu.cc   (contents, props changed)
  head/lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc   (contents, props changed)
  head/lang/v8/files/patch-v8_src_base_platform_platform-posix.cc   (contents, props changed)
  head/lang/v8/files/v8.pc   (contents, props changed)
  head/lang/v8/files/v8_libbase.pc   (contents, props changed)
  head/lang/v8/files/v8_libplatform.pc   (contents, props changed)
Deleted:
  head/lang/v8/files/extra-patch-src-stub-cache.cc
  head/lang/v8/files/patch-CVE-2015-5380
  head/lang/v8/files/patch-src-checks.h
  head/lang/v8/files/patch-src-deoptimizer.cc
  head/lang/v8/files/patch-src-ia32-code-stubs-ia32.cc
  head/lang/v8/files/patch-src-ia32-disasm-ia32.cc
  head/lang/v8/files/patch-src-ia32-ic-ia32.cc
  head/lang/v8/files/patch-src-liveedit.cc
  head/lang/v8/files/patch-src-objects.h
  head/lang/v8/files/patch-src-x64-disasm-x64.cc
  head/lang/v8/files/patch-src-x64-ic-x64.cc
Modified:
  head/lang/v8/Makefile
  head/lang/v8/distinfo
  head/lang/v8/pkg-plist

Modified: head/lang/v8/Makefile
==============================================================================
--- head/lang/v8/Makefile	Fri Nov 20 09:19:29 2020	(r555753)
+++ head/lang/v8/Makefile	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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
+USE_GNOME=	glib20
 
-CPE_VENDOR=	google
+# new release every minutes
+PORTSCOUT=	ignore
 
-SHEBANG_FILES=	build/gyp/gyp
+# 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
 
-.include <bsd.port.pre.mk>
+BUILDTYPE=	Release
 
-.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
+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
 
-.include <bsd.port.post.mk>
+	${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.mk>

Modified: head/lang/v8/distinfo
==============================================================================
--- head/lang/v8/distinfo	Fri Nov 20 09:19:29 2020	(r555753)
+++ head/lang/v8/distinfo	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/extrapatch-clang10
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/extrapatch-clang10	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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"

Added: head/lang/v8/files/patch-build_config_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ]

Added: head/lang/v8/files/patch-build_config_BUILDCONFIG.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_BUILDCONFIG.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/patch-build_config_compiler_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_compiler_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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.

Added: head/lang/v8/files/patch-build_config_compiler_compiler.gni
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_compiler_compiler.gni	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ||

Added: head/lang/v8/files/patch-build_config_features.gni
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_features.gni	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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
+ 

Added: head/lang/v8/files/patch-build_config_freetype_freetype.gni
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_freetype_freetype.gni	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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
+ }

Added: head/lang/v8/files/patch-build_config_linux_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_linux_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ]
+   }
+ }

Added: head/lang/v8/files/patch-build_config_linux_pkg-config.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_linux_pkg-config.py	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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
+ 

Added: head/lang/v8/files/patch-build_config_sysroot.gni
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_config_sysroot.gni	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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 == "") {

Added: head/lang/v8/files/patch-build_detect__host__arch.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_detect__host__arch.py	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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'):

Added: head/lang/v8/files/patch-build_gn__run__binary.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_gn__run__binary.py	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/patch-build_linux_chrome.map
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_linux_chrome.map	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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:
+-  *;
+ };

Added: head/lang/v8/files/patch-build_linux_libpci_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_linux_libpci_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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",
++    ]
++  }
+ }

Added: head/lang/v8/files/patch-build_linux_unbundle_libusb.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_linux_unbundle_libusb.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ]
++}

Added: head/lang/v8/files/patch-build_linux_unbundle_replace__gn__files.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_linux_unbundle_replace__gn__files.py	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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',

Added: head/lang/v8/files/patch-build_toolchain_gcc__toolchain.gni
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_toolchain_gcc__toolchain.gni	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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,
+                            [

Added: head/lang/v8/files/patch-build_toolchain_get__concurrent__links.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_toolchain_get__concurrent__links.py	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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
+ 

Added: head/lang/v8/files/patch-build_toolchain_linux_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-build_toolchain_linux_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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"

Added: head/lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-buildtools_third__party_libc++_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ]
+   }
+ }
+ 

Added: head/lang/v8/files/patch-src_d8_d8-posix.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-src_d8_d8-posix.cc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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>
+ 

Added: head/lang/v8/files/patch-v8_BUILD.gn
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_BUILD.gn	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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" ]
+   }

Added: head/lang/v8/files/patch-v8_include_v8config.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_include_v8config.h	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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))

Added: head/lang/v8/files/patch-v8_src_api_api.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_src_api_api.cc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/patch-v8_src_base_cpu.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_src_base_cpu.cc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_src_base_platform_platform-freebsd.cc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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;

Added: head/lang/v8/files/patch-v8_src_base_platform_platform-posix.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/patch-v8_src_base_platform_platform-posix.cc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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

Added: head/lang/v8/files/v8.pc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/v8.pc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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}

Added: head/lang/v8/files/v8_libbase.pc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/v8_libbase.pc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -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}

Added: head/lang/v8/files/v8_libplatform.pc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/v8/files/v8_libplatform.pc	Fri Nov 20 10:41:13 2020	(r555754)
@@ -0,0 +1,10 @@
+prefix=%%PREFIX%%
+exec_prefix=${prefix}
+libdir=${prefix}/lib

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011201041.0AKAfE62059601>