Skip to content

Fix ARM64EC build failures: LNK4279 POINT icall thunk mismatch with MFC#975

Merged
stephenegriffin merged 2 commits into
mainfrom
copilot/fix-github-actions-job-failure
Jun 12, 2026
Merged

Fix ARM64EC build failures: LNK4279 POINT icall thunk mismatch with MFC#975
stephenegriffin merged 2 commits into
mainfrom
copilot/fix-github-actions-job-failure

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

ARM64EC builds (Debug_Unicode and Release_Unicode) fail at link time because MSVC 14.51 (VS 18) changed how it classifies the POINT struct in ARM64EC icall thunks (i8 — integer register) while the pre-built MFC libraries (uafxcwd.lib, uafxcw.lib) were compiled with an older ABI that emits m8 (struct/memory) thunks for the same functions. Since /WX is set, LNK4279 is promoted to LNK1218 (fatal error).

Affected imported functions:

  • PtInRectDialog.obj vs uafxcwd.lib(wincore.obj) (Debug)
  • WindowFromPoint — LTCG CIL module vs uafxcw.lib(afxbutton.obj) (Release)

Changes

  • UI/Dialogs/Dialog.cpp — Replace the three PtInRect() calls with an inline lambda, removing the imported-function reference from Dialog.obj entirely:

    const auto ptInRect = [](const RECT& rc, POINT p) noexcept {
        return p.x >= rc.left && p.x < rc.right && p.y >= rc.top && p.y < rc.bottom;
    };
    if (ptInRect(rcCloseIcon, pt)) ret = HTCLOSE;
  • Directory.Build.props — Add /IGNORE:4279 to ARM64EC linker settings to suppress the residual LNK4279 from WindowFromPoint (an OS API that can't be inlined). For a trivially-copyable 8-byte struct like POINT, both i8 and m8 thunks produce equivalent code, so this is a safe suppression scoped only to ARM64EC.

    <ItemDefinitionGroup Condition="'$(Platform)' == 'ARM64EC'">
      <Link>
        <AdditionalOptions>/IGNORE:4279 %(AdditionalOptions)</AdditionalOptions>
      </Link>
    </ItemDefinitionGroup>

- Replace PtInRect() calls in Dialog.cpp with an inline lambda to eliminate
  the ARM64EC icall push thunk conflict between our Dialog.obj (i8 thunk)
  and the pre-built MFC library uafxcwd.lib/wincore.obj (m8 thunk).

- Add /IGNORE:4279 to ARM64EC linker settings in Directory.Build.props to
  suppress the remaining LNK4279 warning for WindowFromPoint in
  RichEditOleCallback.cpp vs uafxcw.lib/afxbutton.obj. This warning is a
  diagnostic false-positive: MSVC 14.51+ changed how it classifies the
  trivially-copyable 8-byte POINT struct (i8 vs m8), but both thunks
  produce equivalent code for this struct type.

Fixes: build (Debug_Unicode, ARM64EC) and build (Release_Unicode, ARM64EC)
Copilot AI changed the title [WIP] Fix failing GitHub Actions job build (Debug_Unicode, ARM64EC) Fix ARM64EC build failures: LNK4279 POINT icall thunk mismatch with MFC Jun 12, 2026
Copilot AI requested a review from stephenegriffin June 12, 2026 18:38
@github-actions

Copy link
Copy Markdown

Test Results

    8 files  ±0      8 suites  ±0   46s ⏱️ -7s
  251 tests ±0    251 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 008 runs  ±0  2 008 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1d86955. ± Comparison against base commit a12e399.

@stephenegriffin stephenegriffin marked this pull request as ready for review June 12, 2026 19:44
@stephenegriffin stephenegriffin merged commit d33284a into main Jun 12, 2026
21 checks passed
@stephenegriffin stephenegriffin deleted the copilot/fix-github-actions-job-failure branch June 12, 2026 19:44
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.

3 participants