Could we compile all apps for 4 KiB page sizes too?


could we compile all applications for 4 KiB page sizes in addition to the current 16 KiB, in order to support Apple devices? Or, would this require each application to support it individually? (I doubt that, but I’m no application developer.)

Yes, I realize that this would necessitate more space on the servers, but we should really get the infrastructure ready to support more hardware as Android becomes more easily available on interesting hardware. It’s ultimately just a vaguely bastardised Linux distribution, after all.

If this doesn’t occur, certain developers who bother to provide support shall merely be forced to release versions for different page sizes anyway, so if Android on iPhones etcetera ever becomes popular, the problem shall merely arise in a less manageable form.

I thought this need to be applied individually. Though all of them are built with NDK, different apps need different patch to pass the linker option.

And it seems you misunderstand the problem. According to the project you linked, the native code need to be built for 16KiB page size.

Given the lack of the man power and the little to none benefits, I thought this won’t happen in a foreseeable future. But all the source code is available and you can build the apks yourself. For example, for an app built with ndk-build, you can try adding

android {
    defaultConfig {
        externalNativeBuild {
            ndkBuild {
                arguments "LOCAL_LDFLAGS += -Wl,-z,common-page-size=0x4000 -Wl,-z,max-page-size=0x4000"

to build.gradle.

1 Like

Yeah, @linsui, I worried that each application would need a different patch. Sigh.

However, if what you state is true – that Is this project abandoned? by Thepowa753 · Pull Request #41 · corellium/projectsandcastle · GitHub is incorrect and consequently that iPhones (or at least that iPhone) use/s a 16 KiB page size too – I suppose all is well in that regard, since that can’t be the cause of the problem. At least per that code, it appears decently trivial to test.


I thought the comment means that Android apks are built with 4KiB page size but 16KiB page size is needed to run on iPhone.

Ah, bugger. You’re correct, @linsui. I confused them.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.