-
Notifications
You must be signed in to change notification settings - Fork 2.2k
build: add Android 16KB page size flags to Makefile #10517
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @ajaysehwal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the compatibility of the Android build process by adding specific linker flags to support devices that use 16KB memory pages. This change is crucial for ensuring the application functions correctly across a wider range of Android devices, particularly those with non-standard memory page configurations, by preventing potential memory-related issues during runtime. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly adds the necessary linker flags to the Makefile for building on Android devices with 16KB memory pages. The change is well-contained and follows the existing structure of the Makefile. I've added one suggestion to improve maintainability by extracting the magic number into a named variable.
| ANDROID_BUILD_DIR := $(MOBILE_BUILD_DIR)/android | ||
| ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar | ||
| # For Android, set max page size to 16KB to support devices using 16KB memory pages. | ||
| ANDROID_EXTLDFLAGS := -extldflags=-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.
To improve readability and maintainability, it's good practice to avoid magic numbers. Consider extracting 16384 into a named variable. This makes the configuration clearer and easier to modify if needed in the future.
ANDROID_MAX_PAGE_SIZE := 16384
ANDROID_EXTLDFLAGS := -extldflags=-Wl,-z,max-page-size=$(ANDROID_MAX_PAGE_SIZE)
ziggie1984
left a comment
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.
pending CI (can you add this reference somewhere either in the commit msg or in the makefile: https://developer.android.com/guide/practices/page-sizes)
9ba5a2c to
b68fb00
Compare
Change Description
Description of change / link to associated issue.
Android is starting to shift from 4KB to 16KB memory page sizes on newer devices. This change updates the Android build to set the linker max page size to 16KB, ensuring the generated library continues to work correctly across both page-size configurations.
Reference: https://developer.android.com/guide/practices/page-sizes
This PR includes an Android-specific linker flag added to the Makefile:
ANDROID_EXTLDFLAGS := -extldflags=-Wl,-z,max-page-size=16384
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.