[PR #702] platform: fix unaligned 64-bit accesses on AArch32 #1347

Open
opened 2026-01-29 20:53:37 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/google/brotli/pull/702

State: closed
Merged: Yes


Ensures that Aarch32 Arm builds with an Armv8 compiler do not set
BROTLI_64_BITS.

This scenario is possible with ChromeOS builds, as they may use a
toolchain with the target armv7-cros-gnueabi, but with -march=armv8.
This will set __ARM_ARCH to 8 (defining BROTLI_TARGET_ARMV8), but will
also set __ARM_32BIT_STATE and not __ARM_64BIT_STATE. Without this,
illegal 64-bit non-word-aligned reads (LDRD) may be emitted.

Also fix unaligned 64-bit reads on AArch32 - STRD was still possible to
emit.

**Original Pull Request:** https://github.com/google/brotli/pull/702 **State:** closed **Merged:** Yes --- Ensures that Aarch32 Arm builds with an Armv8 compiler do not set BROTLI_64_BITS. This scenario is possible with ChromeOS builds, as they may use a toolchain with the target armv7-cros-gnueabi, but with -march=armv8. This will set __ARM_ARCH to 8 (defining BROTLI_TARGET_ARMV8), but will also set __ARM_32BIT_STATE and not __ARM_64BIT_STATE. Without this, illegal 64-bit non-word-aligned reads (LDRD) may be emitted. Also fix unaligned 64-bit reads on AArch32 - STRD was still possible to emit.
claunia added the pull-request label 2026-01-29 20:53:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#1347