Skip to content

Fix Windows (MSYS2 MINGW64) build - #41

Open
nealol wants to merge 3 commits into
theMackabu:masterfrom
nealol:windows-mingw-build-fixes
Open

Fix Windows (MSYS2 MINGW64) build#41
nealol wants to merge 3 commits into
theMackabu:masterfrom
nealol:windows-mingw-build-fixes

Conversation

@nealol

@nealol nealol commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Three fixes found while building on Windows with the MINGW64 toolchain:

  • Set _WIN32_WINNT/WINVER to 0x0A00 project-wide: MinGW headers default to
    an older Windows API level, hiding GetCurrentThreadStackLimits,
    CreateFile2, and other Win8+/Win10 APIs the code uses.
  • Same defines for the WAMR subproject (CREATEFILE2_EXTENDED_PARAMETERS in
    core/shared/platform/windows/win_file.c).
  • Build BoringSSL with OPENSSL_NO_ASM on Windows: its x86_64 perlasm needs
    NASM, which Meson's CMake subproject translation does not drive, so the
    asm objects were silently missing and linking failed with undefined
    references (aes_hw_, ChaCha20_, ecp_nistz256_*, ...).

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows build compatibility by updating platform targeting for modern Windows versions.
    • Disabled assembly optimizations in certain Windows/MinGW builds to avoid build and runtime issues.

nea and others added 2 commits July 4, 2026 17:47
Three fixes found while building on Windows with the MINGW64 toolchain:

- Set _WIN32_WINNT/WINVER to 0x0A00 project-wide: MinGW headers default to
  an older Windows API level, hiding GetCurrentThreadStackLimits,
  CreateFile2, and other Win8+/Win10 APIs the code uses.
- Same defines for the WAMR subproject (CREATEFILE2_EXTENDED_PARAMETERS in
  core/shared/platform/windows/win_file.c).
- Build BoringSSL with OPENSSL_NO_ASM on Windows: its x86_64 perlasm needs
  NASM, which Meson's CMake subproject translation does not drive, so the
  asm objects were silently missing and linking failed with undefined
  references (aes_hw_*, ChaCha20_*, ecp_nistz256_*, ...).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lintling

lintling Bot commented Jul 4, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes.

Commits reviewed

Reviewing changes from 66fb9f3 to d9a8497.

Files selected for processing (3)
  • meson/deps/meson.build
  • meson/meson.build
  • vendor/packagefiles/wasm-micro-runtime/meson.build

:3

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR modifies Meson build files to improve Windows/MinGW builds: it disables BoringSSL assembly optimizations via OPENSSL_NO_ASM on MinGW, and adds Windows 10 API version macros (_WIN32_WINNT, WINVER) as compile definitions in both the main meson build and the wasm-micro-runtime vendor package.

Changes

Windows Build Configuration

Layer / File(s) Summary
Disable BoringSSL assembly on MinGW
meson/deps/meson.build
Sets OPENSSL_NO_ASM=1 for the BoringSSL CMake subproject and adds -DOPENSSL_NO_ASM to C and C++ compile arguments.
Add Windows API version macros
meson/meson.build, vendor/packagefiles/wasm-micro-runtime/meson.build
Adds _WIN32_WINNT and WINVER set to 0x0A00 as compile arguments for Windows builds in both the main build and the wasm-micro-runtime vendor package.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related Issues: None specified.

Related PRs: None specified.

Suggested labels: build, windows, meson

Suggested reviewers: theMackabu

Poem

A rabbit tweaks the build with care,
No assembly here, just C laid bare.
Windows ten, the version set,
_WIN32_WINNT — no regret.
Three files touched, small and neat,
A tidy hop, a build complete. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the Windows MSYS2 MINGW64 build.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lintling lintling Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 1 actionable comment.

The diff looks tidy and the changes are purposeful, though one build-correctness concern is worth flagging before merge.


Review info
Commits reviewed

Reviewing changes from 66fb9f3 to d9a8497.

Files selected for processing (3)
  • meson/deps/meson.build
  • meson/meson.build
  • vendor/packagefiles/wasm-micro-runtime/meson.build
Run details
  • Run ID: 309416d1-450c-47aa-b33f-238479ac9bf1
  • Delivery ID: 57366260-77f9-11f1-9c30-cd0105d74627

Comment thread vendor/packagefiles/wasm-micro-runtime/meson.build

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
meson/deps/meson.build (1)

26-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant explicit -DOPENSSL_NO_ASM compile args.

Setting the OPENSSL_NO_ASM CMake variable already causes BoringSSL's own CMakeLists.txt to add the -DOPENSSL_NO_ASM definition for its targets, so the explicit append_compile_args calls are likely unnecessary duplication. Not harmful, but worth double-checking whether they're needed for correctness given how cmake.subproject_options compile args interact with the subproject's own build files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@meson/deps/meson.build` around lines 26 - 30, The BoringSSL Meson setup is
redundantly adding the same OPENSSL_NO_ASM definition twice. In the meson/deps
logic around boringssl_opts, keep the CMake define via add_cmake_defines and
remove the explicit append_compile_args calls for both c and cpp unless you
confirm they are required by the subproject translation path; use the existing
boringssl_opts configuration as the place to make this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@meson/deps/meson.build`:
- Around line 26-30: The BoringSSL Meson setup is redundantly adding the same
OPENSSL_NO_ASM definition twice. In the meson/deps logic around boringssl_opts,
keep the CMake define via add_cmake_defines and remove the explicit
append_compile_args calls for both c and cpp unless you confirm they are
required by the subproject translation path; use the existing boringssl_opts
configuration as the place to make this change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6ec34e4c-33af-45ce-a0a7-c8834fbac126

📥 Commits

Reviewing files that changed from the base of the PR and between 66fb9f3 and d9a8497.

📒 Files selected for processing (3)
  • meson/deps/meson.build
  • meson/meson.build
  • vendor/packagefiles/wasm-micro-runtime/meson.build

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.

1 participant