Skip to content

Instantly share code, notes, and snippets.

View IsHacker003's full-sized avatar

IsHacker IsHacker003

View GitHub Profile
@IsHacker003
IsHacker003 / oneplus_compile.md
Last active May 22, 2026 19:54 — forked from einyx/oneplus_compile.txt
compile android kernel with clang

Background

Google compiles the Pixel 2 kernel with Clang. They shipped the device on Android 8.0 with a kernel compiled with Clang 4.0 (build.config commit and prebuilt kernel commit) and upgraded to Android 8.1 with a kernel compiled with Clang 5.0 (build.config commit and prebuilt kernel commit).

Google uses Clang's link-time optimization and control flow integrity in the Pixel 3 kernel, hardening it against return oriented programming attacks (LTO commit, [CFI commit](https://android.googlesource.com/kernel/msm/+/4ca69fba29179