diff --git a/lang/v8-beta/Makefile b/lang/v8-beta/Makefile index b153df754e11..436b7f04192f 100644 --- a/lang/v8-beta/Makefile +++ b/lang/v8-beta/Makefile @@ -1,109 +1,118 @@ # We follow the beta channel on https://omahaproxy.appspot.com/ -# https://chromium.googlesource.com/v8/v8/+/refs/heads/10.0-lkgr +# https://chromium.googlesource.com/v8/v8/+/refs/heads/10.2-lkgr PORTNAME= v8 -PORTVERSION= 10.1.124.6 +PORTVERSION= 10.2.154.3 CATEGORIES= lang MASTER_SITES= LOCAL/sunpoet/v8/${PORTVERSION:R:R} PKGNAMESUFFIX= -beta DISTFILES= build-${BUILD_REV}.tar.gz \ buildtools-${BUILDTOOLS_REV}.tar.gz \ clang-${CLANG_REV}.tar.gz \ common-${COMMON_REV}.tar.gz \ googletest-${GOOGLETEST_REV}.tar.gz \ icu-${ICU_REV}.tar.gz \ zlib-${ZLIB_REV}.tar.gz DIST_SUBDIR= v8/${PORTVERSION:R:R} EXTRACT_ONLY= ${DISTNAME}.tar.gz MAINTAINER= sunpoet@FreeBSD.org COMMENT= Open source JavaScript engine by Google LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= aarch64 amd64 i386 BUILD_DEPENDS= binutils>=0:devel/binutils \ gn:devel/gn \ ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} LIB_DEPENDS= libicudata.so:devel/icu USES= compiler:c++17-lang cpe gnome ninja pkgconfig python:3.5+,build tar:xz USE_GNOME= glib20 BINARY_ALIAS= python3=${PYTHON_CMD} MAKE_ARGS= -C out/Release USE_LDCONFIG= yes SUB_FILES= v8.pc v8_libbase.pc v8_libplatform.pc USE_GITHUB= yes CPE_VENDOR= google CONFLICTS_INSTALL= v8 -BUILD_REV= 3d9590754d5d23e62d15472c5baf6777ca59df20 -BUILDTOOLS_REV= 113dd1badbcbffea108a8c95ac7c89c22bfd25f3 -CLANG_REV= b60d34c100e5a8f4b01d838527f000faab673da3 +BUILD_REV= b37c340767cf9e7777d4ca5a588c34c5744df9b2 +BUILDTOOLS_REV= c2e4795660817c2776dbabd778b92ed58c074032 +CLANG_REV= b5e2f7c16bbf3aefc9354e8fbad3de0a543f2193 COMMON_REV= d115b033c4e53666b535cbd1985ffe60badad082 -GOOGLETEST_REV= ae5e06dd35c6137d335331b0815cf1f60fd7e3c5 -ICU_REV= 8a5b728e4f43b0eabdb9ea450f956d67cfb22719 -ZLIB_REV= b0676a1f52484bf53a1a49d0e48ff8abc430fafe +GOOGLETEST_REV= af29db7ec28d6df1c7f0f745186884091e602e07 +ICU_REV= 1fd0dbea04448c3f73fe5cb7599f9472f0f107f1 +ZLIB_REV= a6d209ab932df0f1c9d5b7dc67cfa74e8a3272c0 # Run "gn args --list out/Release" for all variables. # Some parts don't have use_system_* flag, and can be turned on/off by using # replace_gn_files.py script, some parts just turned on/off for target host # OS "target_os == is_bsd", like libusb, libpci. GN_ARGS+= clang_use_chrome_plugins=false \ extra_cxxflags="${CXXFLAGS}" \ extra_ldflags="${LDFLAGS}" \ is_clang=true \ + is_component_build=true \ + is_debug=false \ treat_warnings_as_errors=false \ use_aura=true \ use_lld=true \ use_custom_libcxx=false \ v8_use_external_startup_data=false +OPTIONS_DEFINE= EXAMPLES + post-extract: @${MKDIR} ${WRKSRC}/base/trace_event/common ${WRKSRC}/build ${WRKSRC}/buildtools ${WRKSRC}/third_party/googletest/src ${WRKSRC}/third_party/icu ${WRKSRC}/third_party/zlib ${WRKSRC}/tools/clang @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/build-${BUILD_REV}.tar.gz -C ${WRKSRC}/build @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/buildtools-${BUILDTOOLS_REV}.tar.gz -C ${WRKSRC}/buildtools @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/clang-${CLANG_REV}.tar.gz -C ${WRKSRC}/tools/clang @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/common-${COMMON_REV}.tar.gz -C ${WRKSRC}/base/trace_event/common @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/googletest-${GOOGLETEST_REV}.tar.gz -C ${WRKSRC}/third_party/googletest/src @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/icu-${ICU_REV}.tar.gz -C ${WRKSRC}/third_party/icu @${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/zlib-${ZLIB_REV}.tar.gz -C ${WRKSRC}/third_party/zlib post-patch: @${REINPLACE_CMD} -i '' 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/build/toolchain/gcc_toolchain.gni ${WRKSRC}/buildtools/third_party/libc++/BUILD.gn # https://github.com/klzgrad/naiveproxy/blob/master/src/build/config/gclient_args.gni @${ECHO_CMD} 'checkout_google_benchmark = false' > ${WRKSRC}/build/config/gclient_args.gni # Use ICU from ports and create needed directory pre-configure: @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} ./build/linux/unbundle/replace_gn_files.py --system-libraries icu # || ${FALSE} @${MKDIR} ${WRKSRC}/out/Release/gen/shim_headers/icui18n_shim/third_party/icu/source/i18n/unicode ${WRKSRC}/out/Release/gen/shim_headers/icuuc_shim/third_party/icu/source/common/unicode @${MKDIR} ${WRKSRC}/out/Release/gen/include @${CP} -R ${LOCALBASE}/include/unicode ${WRKSRC}/out/Release/gen/include/unicode do-configure: @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} gn gen out/Release --args='${GN_ARGS}' do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/include/cppgc ${STAGEDIR}${PREFIX}/include/libplatform ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/d8 ${STAGEDIR}${PREFIX}/bin/d8 ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/mkgrokdump ${STAGEDIR}${PREFIX}/bin/mkgrokdump ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/mksnapshot ${STAGEDIR}${PREFIX}/bin/mksnapshot + ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/v8_shell ${STAGEDIR}${PREFIX}/bin/v8_shell ${INSTALL_LIB} ${WRKSRC}/out/Release/libchrome_zlib.so ${STAGEDIR}${PREFIX}/lib/libchrome_zlib.so ${INSTALL_LIB} ${WRKSRC}/out/Release/libcppgc.so ${STAGEDIR}${PREFIX}/lib/libcppgc.so ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8_libbase.so ${STAGEDIR}${PREFIX}/lib/libv8_libbase.so ${INSTALL_LIB} ${WRKSRC}/out/Release/libv8_libplatform.so ${STAGEDIR}${PREFIX}/lib/libv8_libplatform.so ${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/ cd ${WRKSRC}/include/cppgc && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/cppgc '-name *\.h' ${INSTALL_DATA} ${WRKSRC}/include/libplatform/*.h ${STAGEDIR}${PREFIX}/include/libplatform/ ${INSTALL_DATA} ${WRKDIR}/v8*.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig/ +do-install-EXAMPLES-on: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/out/Release/v8_simple_* ${STAGEDIR}${EXAMPLESDIR} + .include diff --git a/lang/v8-beta/distinfo b/lang/v8-beta/distinfo index 36e2c9988fd3..149e9fa7409f 100644 --- a/lang/v8-beta/distinfo +++ b/lang/v8-beta/distinfo @@ -1,17 +1,17 @@ -TIMESTAMP = 1650228684 -SHA256 (v8/10.1/build-3d9590754d5d23e62d15472c5baf6777ca59df20.tar.gz) = 02fa820708804f25489f6f9ce8b2d8d9fbc8be28a71707d94bd8c25619087373 -SIZE (v8/10.1/build-3d9590754d5d23e62d15472c5baf6777ca59df20.tar.gz) = 1412762 -SHA256 (v8/10.1/buildtools-113dd1badbcbffea108a8c95ac7c89c22bfd25f3.tar.gz) = b2b5584e6c355f85aeba32f040e77f5d6780fea6ab8bb794eaddae25f0066077 -SIZE (v8/10.1/buildtools-113dd1badbcbffea108a8c95ac7c89c22bfd25f3.tar.gz) = 87013 -SHA256 (v8/10.1/clang-b60d34c100e5a8f4b01d838527f000faab673da3.tar.gz) = a75b61def87693b6942477d81c52db2c0a7451309fdfac6e0e500304f55d10a4 -SIZE (v8/10.1/clang-b60d34c100e5a8f4b01d838527f000faab673da3.tar.gz) = 300514 -SHA256 (v8/10.1/common-d115b033c4e53666b535cbd1985ffe60badad082.tar.gz) = 14d235ff3cc1c035090ef4fe26a9f46c0147474e6eb47ab6cbe85abcb47b84f7 -SIZE (v8/10.1/common-d115b033c4e53666b535cbd1985ffe60badad082.tar.gz) = 10495 -SHA256 (v8/10.1/googletest-ae5e06dd35c6137d335331b0815cf1f60fd7e3c5.tar.gz) = de43e6a5b60920910d0176fd422127eeb1568c585498c9809bfe4892bf232c03 -SIZE (v8/10.1/googletest-ae5e06dd35c6137d335331b0815cf1f60fd7e3c5.tar.gz) = 834526 -SHA256 (v8/10.1/icu-8a5b728e4f43b0eabdb9ea450f956d67cfb22719.tar.gz) = 1390ec1bb71a5d84941f8868c421651690cb6de99ada5626a534b49df9b9244d -SIZE (v8/10.1/icu-8a5b728e4f43b0eabdb9ea450f956d67cfb22719.tar.gz) = 52450740 -SHA256 (v8/10.1/zlib-b0676a1f52484bf53a1a49d0e48ff8abc430fafe.tar.gz) = 79d59e69e2a4c53548b45c9e5c7f601b19af3759d3b00a0792e8789ef51adf3f -SIZE (v8/10.1/zlib-b0676a1f52484bf53a1a49d0e48ff8abc430fafe.tar.gz) = 319424 -SHA256 (v8/10.1/v8-v8-10.1.124.6_GH0.tar.gz) = c14518a050e640b11de330b7e0ec99826f09f25e169c3b395593b3eb2f109e6f -SIZE (v8/10.1/v8-v8-10.1.124.6_GH0.tar.gz) = 27725637 +TIMESTAMP = 1652122565 +SHA256 (v8/10.2/build-b37c340767cf9e7777d4ca5a588c34c5744df9b2.tar.gz) = 527c3f73f5ef790b6a87af93214b23099c66fac3d02465e5cb71b919f742f0d7 +SIZE (v8/10.2/build-b37c340767cf9e7777d4ca5a588c34c5744df9b2.tar.gz) = 1422869 +SHA256 (v8/10.2/buildtools-c2e4795660817c2776dbabd778b92ed58c074032.tar.gz) = 2bacd2c0e58dd75c23683e35848e3071105fdf0d5c4d8ffb24c1ae8d57340f28 +SIZE (v8/10.2/buildtools-c2e4795660817c2776dbabd778b92ed58c074032.tar.gz) = 87048 +SHA256 (v8/10.2/clang-b5e2f7c16bbf3aefc9354e8fbad3de0a543f2193.tar.gz) = 94312a8d1f052def09bd96188cb07f48d71151fbe3ab02fe7d0c5e10a1d59a8a +SIZE (v8/10.2/clang-b5e2f7c16bbf3aefc9354e8fbad3de0a543f2193.tar.gz) = 301116 +SHA256 (v8/10.2/common-d115b033c4e53666b535cbd1985ffe60badad082.tar.gz) = 189d70655308c549c4b18a0d4875e7dbdca061f5041eecb7e3865631ab51ad46 +SIZE (v8/10.2/common-d115b033c4e53666b535cbd1985ffe60badad082.tar.gz) = 10496 +SHA256 (v8/10.2/googletest-af29db7ec28d6df1c7f0f745186884091e602e07.tar.gz) = 67ea233b7e7fe4ec41967500ff59dbdc8a8f35b3b70406542937e4f1b28185c0 +SIZE (v8/10.2/googletest-af29db7ec28d6df1c7f0f745186884091e602e07.tar.gz) = 840854 +SHA256 (v8/10.2/icu-1fd0dbea04448c3f73fe5cb7599f9472f0f107f1.tar.gz) = 22953e0394838abb98596cad7000761de485dfaf437e28cdf2f2da7f33741914 +SIZE (v8/10.2/icu-1fd0dbea04448c3f73fe5cb7599f9472f0f107f1.tar.gz) = 52517961 +SHA256 (v8/10.2/zlib-a6d209ab932df0f1c9d5b7dc67cfa74e8a3272c0.tar.gz) = a7e25489144d9ef67676e842ef0592ff8fb8f90ef65a0f339911af21b0c8ee9e +SIZE (v8/10.2/zlib-a6d209ab932df0f1c9d5b7dc67cfa74e8a3272c0.tar.gz) = 343555 +SHA256 (v8/10.2/v8-v8-10.2.154.3_GH0.tar.gz) = 727d7a7a682e1a6c66134c283f928e9770f13a2937b9e0adf6e27f7a25615212 +SIZE (v8/10.2/v8-v8-10.2.154.3_GH0.tar.gz) = 27792546 diff --git a/lang/v8-beta/files/patch-BUILD.gn b/lang/v8-beta/files/patch-BUILD.gn index 14f0db784cd8..7906d938cd75 100644 --- a/lang/v8-beta/files/patch-BUILD.gn +++ b/lang/v8-beta/files/patch-BUILD.gn @@ -1,32 +1,32 @@ ---- BUILD.gn.orig 2022-03-17 10:34:15 UTC +--- BUILD.gn.orig 2022-04-21 12:21:39 UTC +++ BUILD.gn -@@ -5229,7 +5229,7 @@ v8_component("v8_libbase") { +@@ -5239,7 +5239,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", -@@ -5246,6 +5246,12 @@ v8_component("v8_libbase") { +@@ -5256,6 +5256,12 @@ v8_component("v8_libbase") { ] libs = [ "dl" ] + } else if (is_bsd) { + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-freebsd.cc", + ] + libs = [ "rt", "execinfo" ] } else if (is_android) { if (current_toolchain == host_toolchain) { libs = [ -@@ -5769,6 +5775,7 @@ if (v8_monolithic) { +@@ -5778,6 +5784,7 @@ if (v8_monolithic) { ":v8_libplatform", "//build/win:default_exe_manifest", ] + libs = ["execinfo"] configs = [ ":internal_config" ] } diff --git a/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn b/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn index 794a898973cd..8997cf68b1ed 100644 --- a/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn +++ b/lang/v8-beta/files/patch-build_config_BUILDCONFIG.gn @@ -1,44 +1,44 @@ ---- build/config/BUILDCONFIG.gn.orig 2021-11-15 18:52:18 UTC +--- build/config/BUILDCONFIG.gn.orig 2022-05-07 05:44:29 UTC +++ build/config/BUILDCONFIG.gn @@ -136,7 +136,7 @@ declare_args() { is_official_build = false # Set to true when compiling with the Clang compiler. - is_clang = current_os != "linux" || + is_clang = current_os != "linux" || current_os == "freebsd" || (current_cpu != "s390x" && current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64" && -@@ -189,8 +189,8 @@ if (host_toolchain == "") { +@@ -191,8 +191,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" -@@ -229,7 +229,7 @@ if (target_os == "android") { +@@ -231,7 +231,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" -@@ -296,10 +296,11 @@ is_android = current_os == "android" +@@ -298,10 +298,11 @@ is_android = current_os == "android" is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" -is_linux = current_os == "linux" +is_linux = current_os == "linux" || current_os == "freebsd" is_mac = current_os == "mac" is_nacl = current_os == "nacl" is_win = current_os == "win" || current_os == "winuwp" +is_bsd = current_os == "freebsd" is_apple = is_ios || is_mac is_posix = !is_win && !is_fuchsia diff --git a/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn b/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn index 29e53e72c188..1d2759ad0dac 100644 --- a/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn +++ b/lang/v8-beta/files/patch-build_config_compiler_BUILD.gn @@ -1,101 +1,101 @@ ---- build/config/compiler/BUILD.gn.orig 2022-04-04 20:12:27 UTC +--- build/config/compiler/BUILD.gn.orig 2022-05-07 05:44:29 UTC +++ build/config/compiler/BUILD.gn -@@ -140,7 +140,7 @@ declare_args() { +@@ -137,7 +137,7 @@ declare_args() { # # TODO(crbug.com/1131993): Enabling this when 'is_android' is true breaks # content_shell_test_apk on both ARM and x86. - init_stack_vars = !is_android + init_stack_vars = !is_android && !is_bsd # This argument is to control whether enabling text section splitting in the # final binary. When enabled, the separated text sections with prefix -@@ -357,7 +357,7 @@ config("compiler") { +@@ -352,7 +352,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" && current_os != "zos") { ldflags += [ "-Wl,--fatal-warnings" ] } -@@ -534,7 +534,7 @@ config("compiler") { +@@ -522,7 +522,7 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } - if (is_clang && !is_nacl && current_os != "zos") { + if (is_clang && !is_nacl && !is_bsd && current_os != "zos") { cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] # TODO(hans): Remove this once Clang generates better optimized debug info -@@ -929,7 +929,7 @@ config("compiler_cpu_abi") { +@@ -918,7 +918,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" ] } -@@ -1250,7 +1250,7 @@ config("compiler_deterministic") { +@@ -1239,7 +1239,7 @@ config("compiler_deterministic") { # different build directory like "out/feature_a" and "out/feature_b" if # we build same files with same compile flag. # Other paths are already given in relative, no need to normalize them. - if (is_nacl) { + if (is_nacl || is_bsd) { # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. cflags += [ "-Xclang", -@@ -1263,7 +1263,7 @@ config("compiler_deterministic") { +@@ -1252,7 +1252,7 @@ config("compiler_deterministic") { # and -fcoverage-compilation-dir=. cflags += [ "-ffile-compilation-dir=." ] } - if (!is_win) { + if (!is_win && !is_bsd) { # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) asmflags = [ "-Wa,-fdebug-compilation-dir,." ] } -@@ -1517,7 +1517,7 @@ config("default_warnings") { +@@ -1506,7 +1506,7 @@ config("default_warnings") { "-Wno-unneeded-internal-declaration", ] - if (!is_nacl || is_nacl_saigo) { + if ((!is_nacl || is_nacl_saigo) && !is_bsd) { if (is_win) { # TODO(thakis): https://crbug.com/617318 # Currently goma can not handle case sensitiveness for windows well. -@@ -1853,7 +1853,7 @@ config("thin_archive") { +@@ -1837,7 +1837,7 @@ config("thin_archive") { # archives. # TODO(crbug.com/1221615): Enable on is_apple if use_lld once that no longer # confuses lldb. - if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { + if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) { arflags = [ "-T" ] } else if (is_win && use_lld) { arflags = [ "/llvmlibthin" ] -@@ -2354,7 +2354,7 @@ config("symbols") { +@@ -2338,7 +2338,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) && current_os != "zos") { - cflags += [ "-g2" ] + cflags += [ "-g0" ] } if (!is_nacl && is_clang && !is_tsan && !is_asan && -@@ -2394,7 +2394,7 @@ config("symbols") { +@@ -2378,7 +2378,7 @@ config("symbols") { # sections" there. Maybe just a bug in nacl_switch_32.S. _enable_gdb_index = symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" && - current_os != "zos" && (use_gold || use_lld) && + current_os != "zos" && (use_gold || use_lld) && !is_bsd && # Disable on non-fission 32-bit Android because it pushes # libcomponents_unittests over the 4gb size limit. !(is_android && !use_debug_fission && current_cpu != "x64" && -@@ -2412,7 +2412,7 @@ config("symbols") { +@@ -2396,7 +2396,7 @@ config("symbols") { } if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { - if (is_apple) { + if (is_apple || is_bsd) { # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # Make sure we don't use constructor homing on mac. cflags += [ diff --git a/lang/v8-beta/files/patch-build_config_compiler_compiler.gni b/lang/v8-beta/files/patch-build_config_compiler_compiler.gni index 2d5c39500e57..cbe942235f43 100644 --- a/lang/v8-beta/files/patch-build_config_compiler_compiler.gni +++ b/lang/v8-beta/files/patch-build_config_compiler_compiler.gni @@ -1,11 +1,11 @@ ---- build/config/compiler/compiler.gni.orig 2022-04-04 20:12:27 UTC +--- build/config/compiler/compiler.gni.orig 2022-05-07 05:44:29 UTC +++ build/config/compiler/compiler.gni -@@ -225,7 +225,7 @@ declare_args() { +@@ -224,7 +224,7 @@ enable_arm_cfi_table = is_android && !is_component_bui declare_args() { # Whether to use the gold linker from binutils instead of lld or bfd. - use_gold = !use_lld && !(is_chromecast && is_linux && + use_gold = !use_lld && !is_bsd && !(is_chromecast && is_linux && (current_cpu == "arm" || current_cpu == "mipsel")) && (((is_linux || is_chromeos_lacros) && (current_cpu == "x64" || current_cpu == "x86" || diff --git a/lang/v8-beta/files/patch-build_config_linux_BUILD.gn b/lang/v8-beta/files/patch-build_config_linux_BUILD.gn index c258aa9e3d38..53a026234989 100644 --- a/lang/v8-beta/files/patch-build_config_linux_BUILD.gn +++ b/lang/v8-beta/files/patch-build_config_linux_BUILD.gn @@ -1,11 +1,11 @@ ---- build/config/linux/BUILD.gn.orig 2022-04-04 20:12:27 UTC +--- build/config/linux/BUILD.gn.orig 2022-05-07 05:44:29 UTC +++ build/config/linux/BUILD.gn -@@ -42,7 +42,7 @@ config("runtime_library") { +@@ -41,7 +41,7 @@ config("runtime_library") { + } - if ((!(is_chromeos_ash || is_chromeos_lacros) || - default_toolchain != "//build/toolchain/cros:target") && + if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") && - (!use_custom_libcxx || current_cpu == "mipsel")) { + (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) { libs = [ "atomic" ] } } diff --git a/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni b/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni index ccd1d7c366f7..afbd31f16b88 100644 --- a/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni +++ b/lang/v8-beta/files/patch-build_toolchain_gcc__toolchain.gni @@ -1,45 +1,45 @@ ---- build/toolchain/gcc_toolchain.gni.orig 2022-04-04 20:12:27 UTC +--- build/toolchain/gcc_toolchain.gni.orig 2022-05-07 05:44:30 UTC +++ build/toolchain/gcc_toolchain.gni @@ -53,6 +53,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). # -@@ -780,13 +785,23 @@ template("gcc_toolchain") { +@@ -786,13 +791,23 @@ template("gcc_toolchain") { # use_gold too. 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 = "${prefix}/llvm-readelf" - ar = "${prefix}/llvm-ar" - nm = "${prefix}/llvm-nm" + if (is_bsd) { + prefix = "%%LOCALBASE%%/bin" + cc = "cc" + cxx = "c++" + ld = cxx + readelf = "${prefix}/readelf" + ar = "${prefix}/ar" + nm = "${prefix}/nm" + } else { + prefix = rebase_path("$clang_base_path/bin", root_build_dir) + cc = "$prefix/clang" + cxx = "$prefix/clang++" + ld = cxx + readelf = "${prefix}/readelf" + ar = "${prefix}/llvm-ar" + nm = "${prefix}/llvm-nm" + } forward_variables_from(invoker, [ diff --git a/lang/v8-beta/files/patch-src_api_api.cc b/lang/v8-beta/files/patch-src_api_api.cc index fee9a1131c3e..8f4ee8c04e9b 100644 --- a/lang/v8-beta/files/patch-src_api_api.cc +++ b/lang/v8-beta/files/patch-src_api_api.cc @@ -1,11 +1,11 @@ ---- src/api/api.cc.orig 2022-03-17 10:34:15 UTC +--- src/api/api.cc.orig 2022-04-21 12:21:39 UTC +++ src/api/api.cc -@@ -6044,7 +6044,7 @@ bool v8::V8::Initialize(const int build_config) { +@@ -6064,7 +6064,7 @@ bool v8::V8::Initialize(const int build_config) { return true; } -#if V8_OS_LINUX || V8_OS_DARWIN +#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_FREEBSD bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info, void* context) { #if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED diff --git a/lang/v8-beta/pkg-plist b/lang/v8-beta/pkg-plist index fe822237b60a..fb46563c4a8e 100644 --- a/lang/v8-beta/pkg-plist +++ b/lang/v8-beta/pkg-plist @@ -1,112 +1,123 @@ bin/d8 bin/mkgrokdump bin/mksnapshot +bin/v8_shell include/cppgc/allocation.h include/cppgc/common.h include/cppgc/cross-thread-persistent.h include/cppgc/custom-space.h include/cppgc/default-platform.h include/cppgc/ephemeron-pair.h include/cppgc/explicit-management.h include/cppgc/garbage-collected.h include/cppgc/heap-consistency.h include/cppgc/heap-state.h include/cppgc/heap-statistics.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/name-trait.h include/cppgc/internal/persistent-node.h include/cppgc/internal/pointer-policies.h include/cppgc/internal/write-barrier.h include/cppgc/liveness-broker.h include/cppgc/macros.h include/cppgc/member.h include/cppgc/name-provider.h include/cppgc/object-size-trait.h include/cppgc/persistent.h include/cppgc/platform.h include/cppgc/prefinalizer.h include/cppgc/process-heap-statistics.h include/cppgc/sentinel-pointer.h include/cppgc/source-location.h include/cppgc/testing.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-array-buffer.h include/v8-callbacks.h include/v8-container.h include/v8-context.h include/v8-cppgc.h include/v8-data.h include/v8-date.h include/v8-debug.h include/v8-embedder-heap.h include/v8-embedder-state-scope.h include/v8-exception.h include/v8-extension.h include/v8-external.h include/v8-fast-api-calls.h include/v8-forward.h include/v8-function-callback.h include/v8-function.h include/v8-initialization.h include/v8-inspector-protocol.h include/v8-inspector.h include/v8-internal.h include/v8-isolate.h include/v8-json.h include/v8-local-handle.h include/v8-locker.h include/v8-maybe.h include/v8-memory-span.h include/v8-message.h include/v8-metrics.h include/v8-microtask-queue.h include/v8-microtask.h include/v8-object.h include/v8-persistent-handle.h include/v8-platform.h include/v8-primitive-object.h include/v8-primitive.h include/v8-profiler.h include/v8-promise.h include/v8-proxy.h include/v8-regexp.h include/v8-script.h include/v8-snapshot.h include/v8-statistics.h include/v8-template.h include/v8-traced-handle.h include/v8-typed-array.h include/v8-unwinder-state.h include/v8-unwinder.h include/v8-util.h include/v8-value-serializer-version.h include/v8-value-serializer.h include/v8-value.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-wasm.h include/v8-weak-callback-info.h include/v8.h include/v8config.h lib/libchrome_zlib.so lib/libcppgc.so lib/libv8.so lib/libv8_libbase.so lib/libv8_libplatform.so libdata/pkgconfig/v8.pc libdata/pkgconfig/v8_libbase.pc libdata/pkgconfig/v8_libplatform.pc +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_inspector_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_json_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_multi_return_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_parser_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_regexp_builtins_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_regexp_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_wasm_async_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_wasm_code_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_wasm_compile_fuzzer +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/v8_simple_wasm_fuzzer