Repository navigation
build: fix native addon cross-compilation - #54016
Merged
Merged
Conversation
Linux ARM64 addon rebuilds use host clang with target libc++ libraries. Pass the target triple and sysroot to both compiler and linker. Related: #53390 Assisted-By: GitHub Copilot
MarshallOfSound
approved these changes
Sep 17, 2026
|
No Release Notes |
This was referenced Sep 17, 2026
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54017 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54018 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #54019 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #54020 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Linux ARM64 cross-builds fail while rebuilding the
object-wraptest addon: the linker reports that the target libc++ archives are incompatible withelf64-x86-64.The addon toolchain introduced in #53390 selects Chromium clang and the target build's libc++ libraries but supplies no cross-compilation target or sysroot.
npm_config_arch=arm64configures node-gyp, not clang, so the compiler and linker still default to x64 on an x64 worker.Pass the requested target triple and Electron sysroot to C/C++ compilation and linking, preserving caller flags and reporting missing cross sysroots explicitly.
Related to #53390.
CC @deepak1556 @MarshallOfSound as reviewers/stakeholders of 53390.
CC @mlaurencin as downstream stakeholder
Validation
-###confirms target and sysroot forwarding for ARM64, ARM, ia32, and x64 compilation and linking. This is print-only validation, not a successful cross-build.42-x-y,43-x-y,44-x-y, and45-x-y; the patch applies cleanly to all four, matching fix: backport Node.js cleanup hook fixes for node::ObjectWrap addons #53390's backport coverage.Checklist
npm testpassesRelease Notes
Notes: none