Browse Source

build: fix 11-x-y compiler errors (#25927)

* Add whole src\third_party\angle\.git directory

This directory is needed in order to properly generate gen/angle/angle_commit.h

* fix: correct calling convention for Windows on Arm

https://chromium-review.googlesource.com/c/v8/v8/+/2440717
(cherry picked from commit 0041f5aaa6ea84bf125b200e5977480a267d5203)

Co-authored-by: Shelley Vohr <[email protected]>
John Kleinschmidt 4 years ago
parent
commit
485612ae68

+ 7 - 5
appveyor.yml

@@ -116,14 +116,16 @@ build_script:
       if ($env:SAVE_GCLIENT_SRC -eq 'true') {
         # archive current source for future use 
         # only run on x64/woa to avoid contention saving
-        if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
+        $(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
+        if ($LASTEXITCODE -ne 0) {
           Write-warning "Could not save source to shared drive; continuing anyway"
         }
-        # build time generation of file gen/angle/commit.h depends on
-        # third_party/angle/.git/HEAD.
+        # build time generation of file gen/angle/angle_commit.h depends on
+        # third_party/angle/.git
         # https://chromium-review.googlesource.com/c/angle/angle/+/2074924
-        if ($(7z a $zipfile src\third_party\angle\.git\HEAD;$LASTEXITCODE -ne 0)) {
-          Write-warning "Failed to add third_party\angle\.git\HEAD; continuing anyway"
+        $(7z a $zipfile src\third_party\angle\.git)
+        if ($LASTEXITCODE -ne 0) {
+          Write-warning "Failed to add third_party\angle\.git; continuing anyway"
         }
       }
   - ps: >-

+ 1 - 0
patches/v8/.patches

@@ -9,3 +9,4 @@ revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch
 fix_build_deprecated_attirbute_for_older_msvc_versions.patch
 chore_add_v8_apple_silicon_patches.patch
 fix_use_proper_page_size_for_mac_arm64.patch
+fix_correct_calling_convention_for_windows_on_arm.patch

+ 56 - 0
patches/v8/fix_correct_calling_convention_for_windows_on_arm.patch

@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Richard Townsend <[email protected]>
+Date: Wed, 30 Sep 2020 11:48:59 +0100
+Subject: fix: correct calling convention for Windows on Arm
+
+Corrects a "Check failed: kFPParamRegisterCount == kParamRegisterCount"
+message when compiling v8_snapshot for Windows on Arm.
+
+Unlike x64, Windows on Arm's calling convention does not alternate
+between integer and float registers.
+
+Bug: chromium:1052746
+Change-Id: I4c9cdafcd6e43742b94613f85b2983761cc0891a
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440717
+Commit-Queue: Maya Lekova <[email protected]>
+Reviewed-by: Jakob Gruber <[email protected]>
+Reviewed-by: Maya Lekova <[email protected]>
+Cr-Commit-Position: refs/heads/master@{#70257}
+
+diff --git a/src/compiler/c-linkage.cc b/src/compiler/c-linkage.cc
+index af467f2bb14116006531b261e94ee40c8b12f4d6..5b395067f08ec011451b8ae370b4ac8a643fe47c 100644
+--- a/src/compiler/c-linkage.cc
++++ b/src/compiler/c-linkage.cc
+@@ -139,7 +139,7 @@ namespace {
+ #endif
+ }  // namespace
+ 
+-#ifdef V8_TARGET_OS_WIN
++#if defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
+ // As defined in
+ // https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#parameter-passing,
+ // Windows calling convention doesn't differentiate between GP and FP params
+@@ -176,11 +176,12 @@ void BuildParameterLocations(const MachineSignature* msig,
+     }
+   }
+ }
+-#else  // V8_TARGET_OS_WIN
++#else  // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
+ // As defined in https://www.agner.org/optimize/calling_conventions.pdf,
+ // Section 7, Linux and Mac place parameters in consecutive registers,
+ // differentiating between GP and FP params. That's why we maintain two
+-// separate counters here.
++// separate counters here. This also applies to Arm systems following
++// the AAPCS and Windows on Arm.
+ void BuildParameterLocations(const MachineSignature* msig,
+                              size_t kFPParamRegisterCount,
+                              size_t kParamRegisterCount,
+@@ -216,7 +217,7 @@ void BuildParameterLocations(const MachineSignature* msig,
+     }
+   }
+ }
+-#endif  // V8_TARGET_OS_WIN
++#endif  // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
+ 
+ // General code uses the above configuration data.
+ CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,