Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle: add max-page-size 16384 #1213

Merged
merged 6 commits into from
Oct 14, 2024
Merged

gradle: add max-page-size 16384 #1213

merged 6 commits into from
Oct 14, 2024

Conversation

smore-lore
Copy link
Contributor

This uses Gradle 7, so must specify page size exactly, rather than being able to use the newer options.

This may not update the APK alignment, but you can always run zipalign to realign an unaligned APK. Or, if you pull the .so directly it will work.

This uses Gradle 7, so must specify page size exactly, rather
than being able to use the newer options.
    
This may not update the APK alignment, but you can always run
zipalign to realign an unaligned APK. Or, if you pull the .so
directly it will work.
@@ -60,6 +60,7 @@ if (androidSdkInstalled) {
"-DBORINGSSL_HOME=$boringsslHome",
"-DCMAKE_CXX_STANDARD=17"
cFlags '-fvisibility=hidden',
'-Wl,-z,max-page-size=16384',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest putting linker flags at the end of the list.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually turns out this isn't the way to do it with external cmake, only actual cflags can do in here.

You want to add '-DCMAKE_SHARED_LINKER_FLAGS=-z max-page-size=16384' to the cmake arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, and thank you thank you, I had to do something slightly differently, but I think this should work now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm. CMAKE_SHARED_LINKER_FLAGS needed to be exactly as I quoted (it's already a linker flag so -Wl is redundant... Odd that it didn't error out in CI or local builds as I'm sure it did for me on the 2.5.x branch. Anyways hopefully with that editted this PR should be doing the correct thing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, that builds on MacOS and Windows but not Ubuntu... yay for consistency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, you added it to cflags, not the Cmake arguments...

@prbprbprb prbprbprb merged commit e57bf15 into google:master Oct 14, 2024
37 checks passed
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.

2 participants