Skip to content

fix: build on ARM32 targets - #2063

Merged
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/arm32
Sep 4, 2026
Merged

jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/arm32

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Fixes ARM32 builds in two areas:

  • Makes vendored libunwind derive the ABI width from the compiler pointer size, supporting 32-bit userland under 64-bit kernels.
  • Fixes baseline ARM32 compilation and linking by using type-safe conversions, avoiding the unsupported yield instruction, and linking libatomic when required for 64-bit atomics.

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.
Comment thread cmake/utils.cmake Resolved
@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.27%. Comparing base (1fba2f4) to head (c2ca222).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi merged commit 5ef4c14 into master Sep 4, 2026
71 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/arm32 branch September 4, 2026 15:21
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
sentry-native 0.16.6

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.

- [ ] `resource` blocks have been checked for updates.
<details>
  <summary>release notes</summary>
  <pre>**Features**:

- Add `sentry_is_enabled` for checking whether the SDK has been initialized. ([#2045](getsentry/sentry-native#2045))
- Add `sentry_event_set_level` for setting the level of an individual event. ([#2038](getsentry/sentry-native#2038))

**Fixes**:

- Native/Windows: prevent out-of-bounds PE debug-directory parsing. ([#2062](getsentry/sentry-native#2062))
- Native/Linux: parse minidump-writer ELF build-id notes with `sentry__elf_find_note`. ([#2055](getsentry/sentry-native#2055))
- Native/Linux: prevent malformed ELF metadata from bypassing module address bounds checks through integer overflow or underflow. ([#2064](getsentry/sentry-native#2064))
- Native: Read frame records at pointer width in the crash daemon's frame-pointer walk, so 32-bit targets no longer read two stack slots per pointer. ([#2052](getsentry/sentry-native#2052))
- Native: Report ARM32 registers for Linux crash events, and walk both r11-based ARM32 frame-record shapes (GCC's and clang's; Thumb r7 chains are not walked) in the crash daemon. ([#2053](getsentry/sentry-native#2053))
- Prevent backend state races when `sentry_reinstall_backend` runs concurrently with scope observer callbacks. ([#2041](getsentry/sentry-native#2041))
- Native: clean up stale envelopes after crashes with `SENTRY_TRANSPORT=none`. ([#2049](getsentry/sentry-native#2049))
- `sentry_set_trace` omits `parent_span_id` when the caller does not provide one, instead of serializing it as `null`. ([#2047](getsentry/sentry-native#2047))
- Native/Linux i386: write valid thread stack descriptors to minidumps when stack addresses use the upper half of the 32-bit address space. ([#2054](getsentry/sentry-native#2054))
- Native/Linux: cap ELF metadata section reads when resolving module SONAMEs. ([#2066](getsentry/sentry-native#2066))
- Linux/ARM32: fix builds on 32-bit ARM systems, including 32-bit Raspberry Pi OS installations running a 64-bit kernel. ([#2063](getsentry/sentry-native#2063))
- Guard size arithmetic when parsing envelopes and Linux OS release data, copying slices, and allocating memory during crash handling. ([#2059](getsentry/sentry-native#2059))
- macOS: prevent out-of-bounds reads while parsing Mach-O load commands. ([#2065](getsentry/sentry-native#2065))
- Prevent out-of-bounds reads when parsing JSON numbers from length-delimited buffers. ([#2067](getsentry/sentry-native#2067))
- Validate session replay IDs before accessing staged files to prevent path traversal and unintended file uploads or deletions. ([#2071](getsentry/sentry-native#2071))
- Native/Windows: resolve the WER module relative to `handler_path`, so it is found when the crash handler is installed outside the executable's directory. ([#2073](getsentry/sentry-native#2073))
- Native: prevent buffer attachments from being written outside their UUID run directory. ([#2072](getsentry/sentry-native#2072))
- Native/Windows: reject misleading export fallback symbols in stack traces when PDB files are unavailable. ([#2075](getsentry/sentry-native#2075))

**Thank you**:

- [HuzaifaAbdulRehman](https://github.com/HuzaifaAbdulRehman)
- [GLinnik21](https://github.com/GLinnik21)</pre>
  <p>View the full release notes at <a href="https://github.com/getsentry/sentry-native/releases/tag/0.16.6">https://github.com/getsentry/sentry-native/releases/tag/0.16.6</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!18869
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