fix: build on ARM32 targets - #2063
Merged
Merged
Conversation
Raspberry Pi OS can run a 32-bit armhf userland with a 64-bit
kernel. In that configuration, CMake reports aarch64 as the system
processor while the compiler emits 32-bit ARM code.
Vendored libunwind previously used the system processor for both the
processor family and ABI width. It consequently combined ARM symbols
with AArch64 DWARF headers and produced this diagnostic:
vendor/libunwind/src/dwarf/Gexpr.c: In function
‘_ULarm_dwarf_eval_expr’:
vendor/libunwind/include/tdep-aarch64/dwarf-config.h:37:45:
error: ‘UNW_AARCH64_V31’ undeclared (first use in this function)
vendor/libunwind/src/dwarf/Gexpr.c:359:35:
note: in expansion of macro ‘dwarf_to_unw_regnum’
Normalize processor names into x86 and ARM families, then select the
concrete architecture and ELF class from the compiler pointer width.
This also handles the equivalent 32-bit x86 userland configuration.
Avoid aliasing fixed-width module mapping fields as native pointer and size types in the module finder test. Convert mapped addresses through uintptr_t before widening them to uint64_t. Use nop for CPU relaxation on 32-bit ARM, where the baseline assembler can reject yield as an unsupported instruction. AArch64 continues to use yield. Detect whether 64-bit atomic operations require libatomic and link it when necessary. This supports ARM32 targets where those operations are not provided directly by the compiler's target architecture. This fixes the incompatible pointer type, pointer-to-integer cast, unsupported processor instruction, and unresolved __atomic_load_8 and __atomic_store_8 diagnostics from the ARM32 build.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2063 +/- ##
==========================================
- Coverage 74.36% 74.27% -0.09%
==========================================
Files 103 103
Lines 26677 26677
Branches 4855 4855
==========================================
- Hits 19838 19814 -24
- Misses 5503 5528 +25
+ Partials 1336 1335 -1 🚀 New features to boost your workflow:
|
JoshuaMoelans
approved these changes
Sep 4, 2026
mujacica
approved these changes
Sep 4, 2026
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.
Fixes ARM32 builds in two areas:
yieldinstruction, and linking libatomic when required for 64-bit atomics.