From fe76ba0302b69f749be2417a844189457e517287 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 16 Aug 2022 23:07:00 +0530 Subject: [PATCH 1/4] v8: try fixing build --- mingw-w64-v8/0001-add-mingw-toolchain.patch | 79 +++++++++++++++++++++ mingw-w64-v8/PKGBUILD | 4 +- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/mingw-w64-v8/0001-add-mingw-toolchain.patch b/mingw-w64-v8/0001-add-mingw-toolchain.patch index e7ce5fbfa4..d29c9742f0 100644 --- a/mingw-w64-v8/0001-add-mingw-toolchain.patch +++ b/mingw-w64-v8/0001-add-mingw-toolchain.patch @@ -1311,3 +1311,82 @@ index d449f5925..558e04229 100644 # Copy the VS runtime DLLs into the isolate so that they don't have to be # preinstalled on the target machine. The debug runtimes have a "d" at # the end. +diff --git a/config/win/visual_studio_version.gni b/config/win/visual_studio_version.gni +index 982fbe8d3..cd6608693 100644 +--- a/config/win/visual_studio_version.gni ++++ b/config/win/visual_studio_version.gni +@@ -21,19 +21,20 @@ declare_args() { + # installation location. + windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10" + } +- +-if (visual_studio_path == "") { +- toolchain_data = +- exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope") +- visual_studio_path = toolchain_data.vs_path +- windows_sdk_path = toolchain_data.sdk_path +- visual_studio_version = toolchain_data.vs_version +- wdk_path = toolchain_data.wdk_dir +- visual_studio_runtime_dirs = toolchain_data.runtime_dirs +-} else { +- assert(visual_studio_version != "", +- "You must set the visual_studio_version if you set the path") +- assert(wdk_path != "", +- "You must set the wdk_path if you set the visual studio path") +- visual_studio_runtime_dirs = [] ++if (!is_mingw){ ++ if (visual_studio_path == "") { ++ toolchain_data = ++ exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope") ++ visual_studio_path = toolchain_data.vs_path ++ windows_sdk_path = toolchain_data.sdk_path ++ visual_studio_version = toolchain_data.vs_version ++ wdk_path = toolchain_data.wdk_dir ++ visual_studio_runtime_dirs = toolchain_data.runtime_dirs ++ } else { ++ assert(visual_studio_version != "", ++ "You must set the visual_studio_version if you set the path") ++ assert(wdk_path != "", ++ "You must set the wdk_path if you set the visual studio path") ++ visual_studio_runtime_dirs = [] ++ } + } +diff --git a/toolchain/win/BUILD.gn b/toolchain/win/BUILD.gn +index ef44fefb6..bb939d86e 100644 +--- a/toolchain/win/BUILD.gn ++++ b/toolchain/win/BUILD.gn +@@ -484,7 +484,7 @@ template("win_toolchains") { + } + } + +-if (target_cpu == "x86" || target_cpu == "x64") { ++if (!is_mingw && (target_cpu == "x86" || target_cpu == "x64")) { + win_toolchains("x86") { + toolchain_arch = "x86" + } +@@ -493,7 +493,7 @@ if (target_cpu == "x86" || target_cpu == "x64") { + } + } + +-if (target_cpu == "arm64") { ++if (!is_mingw && target_cpu == "arm64") { + win_toolchains("arm64") { + toolchain_arch = "arm64" + } +@@ -507,10 +507,12 @@ if (target_cpu == "arm64") { + # The only reason it's a separate toolchain is so that it can force + # is_component_build to false in the toolchain_args() block, because + # building nacl64.exe in component style does not work. +-win_toolchains("nacl_win64") { +- toolchain_arch = "x64" +- toolchain_args = { +- is_component_build = false ++if (!is_mingw){ ++ win_toolchains("nacl_win64") { ++ toolchain_arch = "x64" ++ toolchain_args = { ++ is_component_build = false ++ } + } + } + diff --git a/mingw-w64-v8/PKGBUILD b/mingw-w64-v8/PKGBUILD index e30af94781..519173a1e7 100644 --- a/mingw-w64-v8/PKGBUILD +++ b/mingw-w64-v8/PKGBUILD @@ -6,7 +6,7 @@ _realname=v8 pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=9.1.269.39 -pkgrel=2 +pkgrel=3 pkgdesc="Fast and modern Javascript engine (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') @@ -49,7 +49,7 @@ sha256sums=('SKIP' 'SKIP' 'SKIP' '54a2a05c9a7753d45665baff33a233c215c598e9f035ac6368c5de4d83073cd0' - '63f35c12168fcb5f025db2cb3a4bc693cb4546ce561dc95e45d10c1579daf786' + '4398b15db0e2b1d98d8b53de04a5cf105233febaddc46a9c6e682d14284dff30' '4d3bac3c43a7e26fa74f0f6e787e609953c36a9e37e097d5df8f16fc795c289c' 'd0fc4abfce69f9a45421fcb9577c1488b9559491f161d53dd56b4290b7727627' 'c10169e7a34e212b1a2bf0eaf45131485719f32a7c34d9a666b692f05a2aa830' From 126e43b40a179ba85bfb2318d39540abc0c14366 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Wed, 17 Aug 2022 13:45:38 +0530 Subject: [PATCH 2/4] Add pkg-config to makedep --- mingw-w64-v8/PKGBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/mingw-w64-v8/PKGBUILD b/mingw-w64-v8/PKGBUILD index 519173a1e7..255fc1b5f7 100644 --- a/mingw-w64-v8/PKGBUILD +++ b/mingw-w64-v8/PKGBUILD @@ -13,6 +13,7 @@ mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') url="https://v8.dev" license=("BSD") makedepends=( + "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-cc" From c1addc1aa869b72ac15ebd0afbca16160c70d931 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Wed, 17 Aug 2022 17:20:02 +0530 Subject: [PATCH 3/4] disable -Werror when building --- mingw-w64-v8/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-v8/PKGBUILD b/mingw-w64-v8/PKGBUILD index 255fc1b5f7..e8dfe9540e 100644 --- a/mingw-w64-v8/PKGBUILD +++ b/mingw-w64-v8/PKGBUILD @@ -168,7 +168,7 @@ build() { cd "${srcdir}"/v8-${pkgver} # v8_enable_system_instrumentation=false is required because MinGW does not provide TraceLoggingProvider.h yet, remove once it does. - "${srcdir}"/gn/out/${CARCH}/gn gen "${PWD}/out/${BUILDTYPE}-${CARCH}" --args="is_debug=${_is_debug} is_component_build=true target_cpu=\"${_arch}\" is_clang=${_is_clang} use_custom_libcxx=false v8_enable_verify_heap=false icu_use_data_file=false enable_iterator_debugging=${_is_debug} ${_compiler_specific_args} v8_use_external_startup_data=true v8_enable_system_instrumentation=false" + "${srcdir}"/gn/out/${CARCH}/gn gen "${PWD}/out/${BUILDTYPE}-${CARCH}" --args="is_debug=${_is_debug} is_component_build=true target_cpu=\"${_arch}\" is_clang=${_is_clang} use_custom_libcxx=false v8_enable_verify_heap=false icu_use_data_file=false enable_iterator_debugging=${_is_debug} ${_compiler_specific_args} v8_use_external_startup_data=true v8_enable_system_instrumentation=false treat_warnings_as_errors=false" ninja -C "${PWD}/out/${BUILDTYPE}-${CARCH}" :v8_libbase :v8_libplatform :v8 :d8 :torque :torque-language-server :mksnapshot } From 04ebfb7c923d8d89d2332e82257a5bed12185dc9 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Wed, 17 Aug 2022 21:07:39 +0530 Subject: [PATCH 4/4] update jinja --- mingw-w64-v8/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-v8/PKGBUILD b/mingw-w64-v8/PKGBUILD index e8dfe9540e..e445d28b32 100644 --- a/mingw-w64-v8/PKGBUILD +++ b/mingw-w64-v8/PKGBUILD @@ -28,7 +28,7 @@ source=("bare-clones/gn::git+https://gn.googlesource.com/gn#tag=5da62d5e9d0f10cb "bare-clones/zlib::git+https://chromium.googlesource.com/chromium/src/third_party/zlib.git#commit=156be8c52f80cde343088b4a69a80579101b6e67" "bare-clones/common::git+https://chromium.googlesource.com/chromium/src/base/trace_event/common.git#commit=dab187b372fc17e51f5b9fad8201813d0aed5129" "bare-clones/googletest::git+https://chromium.googlesource.com/external/github.com/google/googletest.git#commit=10b1902d893ea8cc43c69541d70868f91af3646b" - "bare-clones/jinja2::git+https://chromium.googlesource.com/chromium/src/third_party/jinja2.git#commit=b41863e42637544c2941b574c7877d3e1f663e25" + "bare-clones/jinja2::git+https://chromium.googlesource.com/chromium/src/third_party/jinja2.git#commit=ee69aa00ee8536f61db6a451f3858745cf587de6" "bare-clones/markupsafe::git+https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git#commit=8f45f5cfa0009d2a70589bcda0349b8cb2b72783" "bare-clones/clang::git+https://chromium.googlesource.com/chromium/src/tools/clang.git#commit=ba668f13d135f1d01faf9b03c9a05f5877ac3f51" "0000-add-mingw-main-code-changes.patch"