blob: 28b61e6c520d1ec2eaa10ea02881368d5601d26e [file] [log] [blame] [view]
Yifan Hong59c425d2021-12-13 20:25:02 -08001# Kleaf - Building Android Kernels with Bazel
2
Ulises Mendez Martinezf91c18d2025-03-25 15:45:49 +00003[TOC]
Yifan Hong59c425d2021-12-13 20:25:02 -08004
Yifan Hongc0993832024-02-01 16:04:40 -08005### Getting started
6
Yifan Hong59c425d2021-12-13 20:25:02 -08007[Introduction to Kleaf](docs/kleaf.md)
Yifan Honga93fd332021-12-13 16:46:23 -08008
9[Building your kernels and drivers with Bazel](docs/impl.md)
10
Yifan Hongde436702023-06-06 14:01:04 -070011[Creating distributions](docs/dist.md)
12
Yifan Hongc0993832024-02-01 16:04:40 -080013[Driver Development Kit (DDK)](docs/ddk/main.md)
14
15[Cheatsheet](docs/cheatsheet.md)
16
17### Configuring your build
18
Yifan Hong5541ac822022-04-14 20:37:03 -070019[`build.sh` build configs](docs/build_configs.md)
20
Yifan Hongbb0ef452023-08-08 15:41:26 -070021[Configuring kernel\_build](docs/kernel_config.md)
Yifan Hong12cc8812022-10-26 12:12:20 -070022
Yifan Hongc0993832024-02-01 16:04:40 -080023### ABI monitoring
24
Yifan Hong9b954912022-06-02 15:47:40 -070025[Support ABI monitoring (GKI)](docs/abi.md)
26
27[Support ABI monitoring (Device)](docs/abi_device.md)
Yifan Hongfc484122022-04-11 18:53:20 -070028
Yifan Hongc0993832024-02-01 16:04:40 -080029### Debugging and testing
Yifan Hong9bb07e82022-03-29 15:37:24 -070030
Yifan Honga93fd332021-12-13 16:46:23 -080031[Resolving common errors](docs/errors.md)
Yifan Hong28184012022-02-03 11:48:27 -080032
Yifan Hong8fc84a82022-03-28 16:36:36 -070033[Kleaf testing](docs/testing.md)
Yifan Hongb3b47462022-04-13 15:53:23 -070034
Yifan Hongc0993832024-02-01 16:04:40 -080035[Debugging Kleaf](docs/debugging.md)
36
Ulises Mendez Martinez35c2f672024-06-07 14:31:16 +000037[Visualizing dependencies](docs/dependencies.md)
38
Yifan Hongc0993832024-02-01 16:04:40 -080039### Advanced topics
40
41[Handling SCM version](docs/scmversion.md)
42
Yifan Hongef024d52022-06-15 14:41:10 -070043[Building against downloaded prebuilts](docs/download_prebuilt.md)
44
HONG Yifan52b1f882024-07-16 18:13:11 -070045[Bzlmod support (also: setting up workspace)](docs/bzlmod.md)
Yifan Hongc2a0f692024-02-01 15:52:00 -080046
Yifan Hong707b3932023-01-10 13:13:47 -080047[Building `compile_commands.json`](docs/compile_commands.md)
48
Yifan Hong46779ed2023-06-09 13:38:42 -070049[Ensuring hermeticity](docs/hermeticity.md)
50
Ulises Mendez Martinez433b3212023-06-02 12:49:59 +000051[Internet Access](docs/network.md)
52
Yifan Hong4624cb92023-06-21 16:17:59 -070053[Toolchain resolution](docs/toolchains.md)
54
Yifan Hongda329df2023-08-08 16:01:43 -070055[Checkpatch](docs/checkpatch.md)
56
Yifan Hongc0993832024-02-01 16:04:40 -080057[Kleaf Development](docs/kleaf_development.md)
58
Matthias Maennichbbdd6e82024-05-14 22:13:22 +000059[Discover newest Kleaf features in Canary](docs/canary.md)
60
Yifan Hongc0993832024-02-01 16:04:40 -080061### Configurations in command line
Yifan Hongc07e92d2022-04-13 22:32:41 -070062
Yifan Hong6ef0ee62022-04-13 16:15:05 -070063`--config=fast`: [Make local builds faster](docs/fast.md)
64
65`--config=local`: [Sandboxing](docs/sandbox.md)
Yifan Hong0f81d632022-04-19 00:22:19 -070066
Yifan Honga254a172022-12-07 14:30:36 -080067`--config=release`: [Release builds](docs/release.md)
68
Yifan Hong0f81d632022-04-19 00:22:19 -070069`--config=stamp`: [Handling SCM version](docs/scmversion.md)
Yifan Hong7e41c062022-06-02 16:09:27 -070070
Matthias Maennichbbdd6e82024-05-14 22:13:22 +000071`--config=canary`: [Kleaf Canary Features](docs/canary.md)
72
HONG Yifan68308752024-08-15 13:16:18 -070073`--config=musl`: [Use musl libc for host binaries](docs/musl.md)
74
Yifan Hongd6d41092023-02-24 11:33:12 -080075### Flags
76
Yifan Hong71d5cbc2023-07-18 20:44:12 -070077For a full list of flags, run
78
79```sh
80$ tools/bazel help kleaf
81```
82
Yifan Honga254a172022-12-07 14:30:36 -080083`--gcov`: [Keep GCOV files](docs/gcov.md)
Yifan Hong9a176062022-06-23 18:01:27 -070084
85`--kasan`: [kasan](docs/kasan.md)
Ulises Mendez Martinezc2ac77f2022-11-15 15:11:36 +000086
Yifan Honga254a172022-12-07 14:30:36 -080087`--kbuild_symtypes`: [KBUILD\_SYMTYPES](docs/symtypes.md)
88
Yifan Hong73956162022-11-23 18:57:36 -080089`--kgdb`: [GDB scripts](docs/kgdb.md)
90
Yifan Honga254a172022-12-07 14:30:36 -080091`--lto`: [Configure LTO during development](docs/lto.md)
Ulises Mendez Martinez601bc5a2022-12-30 16:48:43 +000092
Yifan Hongd6d41092023-02-24 11:33:12 -080093`--notrim`: Disables `TRIM_NONLISTED_KMI` globally.
94
Aleksei Vetrove606b2e2023-02-20 22:40:27 +000095`--btf_debug_info`: [Enable/disable BTF debug information](docs/btf.md)
96
Ulises Mendez Martinez8ffe2942023-05-26 10:02:06 +000097`--gki_build_config_fragment`:
98[Supporting GKI\_BUILD\_CONFIG\_FRAGMENT on Kleaf](docs/gki_build_config_fragment.md)
Ulises Mendez Martinez58d2a892023-04-28 23:38:16 +000099
Yifan Hong1e242792023-06-22 13:43:28 -0700100`--defconfig_fragment`: [Defconfig fragments](docs/kernel_config.md#defconfig-fragments)
101
Yifan Hong952024e2023-03-01 15:59:39 -0800102Other flags for debugging and disabling integrity checks may be found in the
103[Debugging Kleaf](docs/debugging.md) page.
104
Yifan Hong5bf575c2023-01-24 15:54:34 -0800105### References
106
Ulises Mendez Martinez8ffe2942023-05-26 10:02:06 +0000107[References to Bazel rules and macros for the Android Kernel](docs/api_reference.md)