Skip to content

Conversation

@ajaysehwal
Copy link

@ajaysehwal ajaysehwal commented Jan 22, 2026

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

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Android Build Compatibility: Introduced a new ANDROID_EXTLDFLAGS variable in the Makefile to explicitly set the maximum page size to 16KB for Android builds.
  • Linker Flags Update: Integrated the ANDROID_EXTLDFLAGS into the ldflags of the gomobile bind command for the Android build target, ensuring the 16KB page size is applied during compilation.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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

Choose a reason for hiding this comment

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

medium

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)

@Roasbeef Roasbeef added this to the v0.21.0 milestone Jan 22, 2026
@saubyk saubyk added this to v0.21 Jan 22, 2026
@saubyk saubyk moved this to In progress in v0.21 Jan 22, 2026
Copy link
Collaborator

@ziggie1984 ziggie1984 left a 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants