Skip to content

Conversation

@grendello
Copy link
Contributor

@grendello grendello commented Nov 24, 2025

Fixes: #10601
Context: https://android.googlesource.com/platform//system/extras/+/3c784e9fd9f4e3f8e363a023939567c41c19d634%5E%21/#F0

For 64-bit native libraries Android allows the alignment to be 16k at the minimum,
with any higher value acceptable as long as it's a power of two.

With this commit we follow suit, accepting the same set of values as Android.

Fixes: #10601

Android allows libraries aligned to at least 16k, as long as they
are aligned to a power of two. Follow suit.
//
// https://android.googlesource.com/platform//system/extras/+/3c784e9fd9f4e3f8e363a023939567c41c19d634%5E%21/#F0
//
if (segment64.Alignment >= pageSize && (segment64.Alignment % 2 == 0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for a number like 4 or 8 (kb) to come in as the page size? And that wouldn't be 16kb?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(discussed in meeting) as-is might be fine, actually checking >= 16kb makes it more complicated for 32-bit

@grendello
Copy link
Contributor Author

The MAUI integration lane is broken across all the PRs, I'm going to merge this PR because all
the other tests worked fine.

@grendello grendello merged commit 49479b9 into main Nov 25, 2025
57 of 59 checks passed
@grendello grendello deleted the dev/grendel/dso-alignment-warning branch November 25, 2025 09:05
jonathanpeppers pushed a commit that referenced this pull request Nov 25, 2025
Fixes: #10601
Context: https://android.googlesource.com/platform//system/extras/+/3c784e9fd9f4e3f8e363a023939567c41c19d634%5E%21/#F0

For 64-bit native libraries Android allows the alignment to be 16k at the minimum,
with any higher value acceptable as long as it's a power of two.

With this commit we follow suit, accepting the same set of values as Android.
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.

XA0141 warning is out of date for valid alignments that are a multiple of 16 KB

3 participants