Skip to content

FalconJaw/android-kernel-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toolchains (GCC & Clang 9 and 11) with libraries for compiling Android kernel.

[Not noob friendly.]

Getting Started

How to use these toolchains for compiling android Kernels ?


  1. Clone this toolchain repo in tools folder
$ git clone https://github.com/mranonymz/android-kernel-tools.git tools
  1. Set path according to your choice.
	PATH="tools/build-tools/linux-x86/bin:$PATH"
	PATH="tools/build-tools/path/linux-x86:$PATH"
	PATH="tools/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:$PATH"
	PATH="tools/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:$PATH"
	PATH="tools/clang/host/linux-x86/**clang-r407598**/bin:$PATH"
	PATH="tools/misc/linux-x86/lz4:$PATH"
	PATH="tools/misc/linux-x86/dtc:$PATH"
	PATH="tools/misc/linux-x86/libufdt:$PATH"
	export LD_LIBRARY_PATH="tools/clang/host/linux-x86/**clang-r407598**/lib64:$LD_LIBRARY_PATH"

Here clang-r353983d for AOSP clang 9.0.4 and clang-r399163b for AOSP clang 11.0.5. and clang-r407598 for AOSP clang 12.0.1.

  1. Use these command for compiling with clang.
$ make \
  O=out \
  ARCH=arm64 \
  SUBARCH=ARM64 \
  CC=clang \
  HOSTCC=clang \
  HOSTCXX=clang++ \
  CLANG_TRIPLE=aarch64-linux-gnu- \
  CROSS_COMPILE=aarch64-linux-android- \
  CROSS_COMPILE_ARM32=arm-linux-androideabi- \
  ${DEVICE}_defconfig
  1. Use this command for compiling only with gcc.
$ make \
  O=out \
  ARCH=arm64 \
  SUBARCH=ARM64 \
  CLANG_TRIPLE=aarch64-linux-gnu- \
  CROSS_COMPILE=aarch64-linux-android- \
  CROSS_COMPILE_ARM32=arm-linux-androideabi- \
  ${DEVICE}_defconfig

Here ${DEVICE}_defconfig is the kernel config file used to compile kernel.

It will be easy to compile kernel with a bash script. Make a bash script in kernel folder and set toolchain path according to your folders.

You can use one like This.

All source credit goes to : Android Open Source Project

Give a star if u liked my work :)

About

Toolchains (GCC & Clang 9 and 11) with libraries for compiling Android kernel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published