-
Notifications
You must be signed in to change notification settings - Fork 278
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
Conversation
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.
android/build.gradle
Outdated
@@ -60,6 +60,7 @@ if (androidSdkInstalled) { | |||
"-DBORINGSSL_HOME=$boringsslHome", | |||
"-DCMAKE_CXX_STANDARD=17" | |||
cFlags '-fvisibility=hidden', | |||
'-Wl,-z,max-page-size=16384', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
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.