Skip to content

Fix SPEC CPU win-arm64 build failure caused by invalid -march=armv8-a#742

Merged
ericavella merged 2 commits into
mainfrom
users/evellanoweth/speccpu-win-arm64-march
Jul 10, 2026
Merged

Fix SPEC CPU win-arm64 build failure caused by invalid -march=armv8-a#742
ericavella merged 2 commits into
mainfrom
users/evellanoweth/speccpu-win-arm64-march

Conversation

@ericavella

Copy link
Copy Markdown
Contributor

Problem

The QoS_VC_*_PERF-SPECCPU-*-win-arm64 goals report WORKLOAD METRICS: MISSING — VirtualClient runs for the full execution window but emits zero SPEC metrics.

Root cause: on Windows the SPEC CPU 2017 toolchain is always the x86_64 Cygwin GCC (there is no Arm64 Cygwin distribution). On win-arm64 it runs under x64 emulation and targets x86_64. The PERF-SPECCPU-*.json profiles derived the optimizing flags purely from CPU architecture:

-march={calculate("{Architecture}" == "x64" ? "native" : "armv8-a")}

On win-arm64 this yields -march=armv8-a, which the x86_64 Cygwin gcc/gfortran reject:

cc1:  error: bad value 'armv8-a' for '-march=' switch
f951: Error: bad value 'armv8-a' for '-march=' switch

Every benchmark's specmake build fails (exit 2), but runspeccpu.bat still returns exit 0, so SpecCpuExecutor emits no metrics and the failure surfaces as "metrics missing" rather than a build error.

Fix

On any Windows platform (Cygwin ⇒ x86_64) resolve -march to native. Only linux-arm64 continues to use armv8-a.

-march={calculate(("{Platform}".StartsWith("win") || "{Architecture}" == "x64") ? "native" : "armv8-a")}

Applied to all four profiles: PERF-SPECCPU-FPRATE/FPSPEED/INTRATE/INTSPEED.json.

Validation

  • Reproduced the exact make.out compiler error on a real win-arm64 (Cobalt 100) VM using x86_64 Cygwin gcc/gfortran 14.4.0, and confirmed -march=native compiles cleanly (exit 0).
  • Added a ProfileExpressionEvaluator regression test covering win-arm64 → native, win-x64 → native, linux-x64 → native, linux-arm64 → armv8-a.
  • Existing SpecCpuProfileTests parameter-inlining tests pass for all four profiles.

Note

Separately, runspeccpu.bat / SpecCpuExecutor swallow the specmake build failure (exit 0), which is what turned this into a silent "metrics missing" instead of a hard failure. That robustness fix is out of scope here but worth a follow-up.

On Windows the SPEC CPU 2017 toolchain is always the x86_64 Cygwin GCC
(there is no Arm64 Cygwin distribution), so it runs under x64 emulation on
win-arm64 and targets x86_64. The PERF-SPECCPU-*.json profiles computed the
optimizing flags purely from CPU architecture:

    -march={calculate("{Architecture}" == "x64" ? "native" : "armv8-a")}

On win-arm64 this produced -march=armv8-a, which the x86_64 Cygwin gcc/gfortran
reject:

    cc1:  error: bad value 'armv8-a' for '-march=' switch
    f951: Error: bad value 'armv8-a' for '-march=' switch

Every benchmark's `specmake build` therefore failed (exit 2), but
runspeccpu.bat still returned exit 0, so SpecCpuExecutor emitted zero metrics
and the QoS goals surfaced as "metrics missing" instead of a build error.

Fix: on any Windows platform (Cygwin => x86_64), resolve -march to native.
Only linux-arm64 continues to use armv8-a.

Validated on a real win-arm64 (Cobalt 100) VM: reproduced the exact make.out
compiler error with the x86_64 Cygwin gcc 14.4.0, confirmed -march=native
compiles successfully, and added a ProfileExpressionEvaluator regression test
covering win-arm64, win-x64, linux-x64 and linux-arm64.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@ericavella ericavella enabled auto-merge (squash) July 10, 2026 18:05
@ericavella ericavella merged commit cdc541c into main Jul 10, 2026
5 checks passed
@ericavella ericavella deleted the users/evellanoweth/speccpu-win-arm64-march branch July 10, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants