Nico Weber d7aeda9fca Prepare for building with clang
* Switch to Chromium's clang package on Windows. Fuchsia's clang
  package uses symlinks, which don't Just Work. See comment 3
  on the linked bug for details.

* Also tweak the installed path of the clang package to use
  win-amd64 instead of windows-amd64 to match gn's host_os
  variable, which is needed by the mini_chromium change in the
  roll mentioned below.

* Add `__declspec(noinline)` to sources of some end-to-end test
  binaries where the test expects a certain stack layout that's
  perturbed by inlining

* self_destroying_test_program.cc failed with Access Violation
  instead of with Breakpoint. I'm not 100% sure what's happening
  there as I couldn't reproduce it on my machine. The test uses
  VirtualFree(..., MEM_DECOMMIT) to make parts of the stack unreadable
  to make sure crashpad can handle that. My theory is that clang
  optimized out the call to `_alloca()`, which results in not enough
  of the stack being around for VirtualFree() to be able to decommit.
  https://geidav.wordpress.com/tag/reserved-memory/#:~:text=How%20does%20Windows%20manage%20stack%20memory%3F
  and https://godbolt.org/z/YdbYdKeMh suggest that this theory is
  not completely off -- but the
  `[[maybe_unused]] volatile void* do_not_optimize_away` bit feels
  homeopathic. And yet, with it this seems to pass CQ (see try results
  at patch sets 12 and 20) and without it it doesn't (see patch set 19).
  Maybe this was just luck and the test still feels flakily!
  (The linker's `/STACK` defaults to 1MB stack reserved and 4K
  committed -- 4K kind of seems like it should be enough for that
  VirtualFree call to succeed if that really is the problem.)
  So this part is a bit experimental.

Anyways, nothing uses clang yet, so no behavior change at this point
(other than `gclient sync` downloading less stuff and not failing
by default on Windows).

Includes a one-rev mini_chromium roll:

12ef786772..08d490553b

$ git log 12ef78677..08d490553 --date=short --no-merges --format='%ad %ae %s'
2025-02-13 thakis Prepare mini_chromium for using clang on Windows

Bug: 384682775
Change-Id: I33b54acf18cb6eadfd2167c76c0b4a5824efa64d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6242577
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
2025-02-24 11:37:06 -08:00
..
2023-11-06 22:00:17 +00:00
2025-02-24 11:37:06 -08:00
2024-09-03 17:27:07 +00:00
2023-05-17 15:47:06 +00:00
2024-11-05 16:26:33 +00:00