lvkuiyong / FrankeNDK

Frankenstein NDK for building Magisk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FrankeNDK

Support SDK: 14 - 28
Host Platform: Linux, macOS, Windows
Host Arch: x86_64
Target Arch: ARMv7, ARM64, x86, x86_64 (64 bit only on SDK 21+)

Downloads

Latest Release

Why FrankeNDK?

Starting from NDK r11, all built dynamically linked binaries will cause linker warning on Android 5.1 (details: android-ndk/ndk: #622). To overcome this issue, Magisk's binaries were always built with the extremely obsolete NDK r10e, which means all improvements in later NDKs like Unified Header, modern Clang, and C++17 cannot be used. This became more and more annoying.

Another reason is that newer NDK versions ship with significant larger static libraries (like libc.a) than the old ones. Magisk is optimized to build the smallest binary as possible, so we have to also find a way to overcome this.

How FrankeNDK?

First step is to strip out the unsupported DT entries in all shared libraries with elf-cleaner to prevent linker warnings. Then, we "Frankenstein" r10e's static platform libraries, forcing the build system to use super small static libraries when building static binaries.

Notes

The latest FrankeNDK (r2) is based on official r17c because it is the last version with GCC included (BusyBox requires GCC to compile properly). Only SDK 16 and 21 have the static libraries replaced with r10e's, as these are the 2 SDK targets Magisk will be using. For other SDK versions, the only difference from official NDK is the stripped out DT entries.

About

Frankenstein NDK for building Magisk


Languages

Language:C++ 40.4%Language:C 26.4%Language:Python 20.6%Language:HTML 8.8%Language:RenderScript 1.1%Language:CMake 0.8%Language:XC 0.5%Language:XS 0.4%Language:Makefile 0.4%Language:Shell 0.2%Language:Perl 0.1%Language:Roff 0.1%Language:JavaScript 0.1%Language:Emacs Lisp 0.1%Language:Objective-C 0.0%Language:CSS 0.0%Language:Assembly 0.0%Language:Ruby 0.0%Language:AppleScript 0.0%Language:Batchfile 0.0%Language:GDB 0.0%