[PR #699] [MERGED] platform: fix unaligned 64-bit accesses on AArch32 #1341

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

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/699
Author: @stephenkyle-ARM
Created: 7/17/2018
Status: Merged
Merged: 7/24/2018
Merged by: @eustas

Base: masterHead: fix-armv7-builds


📝 Commits (1)

  • fe4316c platform: fix unaligned 64-bit accesses on AArch32

📊 Changes

1 file changed (+35 additions, -10 deletions)

View changed files

📝 c/common/platform.h (+35 -10)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/699 **Author:** [@stephenkyle-ARM](https://github.com/stephenkyle-ARM) **Created:** 7/17/2018 **Status:** ✅ Merged **Merged:** 7/24/2018 **Merged by:** [@eustas](https://github.com/eustas) **Base:** `master` ← **Head:** `fix-armv7-builds` --- ### 📝 Commits (1) - [`fe4316c`](https://github.com/google/brotli/commit/fe4316c48ef36f56bf65e33245d22d8d14993ef2) platform: fix unaligned 64-bit accesses on AArch32 ### 📊 Changes **1 file changed** (+35 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `c/common/platform.h` (+35 -10) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:53:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#1341