GithubHelp home page GithubHelp logo

minaripenguin / android-kernel-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pkm774/android-kernel-tools

1.0 0.0 0.0 802.09 MB

AOSP (GCC 4.9 & Clang 13 ), Snapdragon Clang 8.0.6

Shell 0.08% JavaScript 0.03% Ruby 0.01% C++ 47.26% Python 15.56% Perl 0.17% C 31.77% Emacs Lisp 0.03% Fortran 0.05% AppleScript 0.01% XC 0.20% CSS 0.02% Pawn 0.01% SourcePawn 0.05% Makefile 0.01% HTML 1.42% CMake 0.43% XS 0.19% Batchfile 0.04% Roff 2.72%

android-kernel-tools's Introduction

Kernel Toolchains

AOSP (GCC & Clang ) and Snapdragon Clang


How to compile android kernel? Detailed Instructions Here.
Install latest version of Make from Here.
Instructions here are only for Linux OS machines, don't get messed in Windows unless you know how to use properly.

Getting Started


How to use these toolchains for compiling android Kernels ?


  1. Clone this toolchain repo in tools folder
$ git clone --depth=1 https://github.com/pkm774/android-kernel-tools tools
  1. Install required packages, for Debian distros :
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install gcc-aarch64-linux-gnu -y

-> Now compile using AOSP clang or Snapdragon clang.

For using AOSP clang:

  1. Set path for the toolchains.
$	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-r428724/bin:$PATH"
$	export LD_LIBRARY_PATH="tools/clang/host/linux-x86/clang-r428724/lib64:$LD_LIBRARY_PATH"
  1. Export required flags
$	export ARCH=arm64
$	export SUBARCH=ARM64
$	export CLANG_TRIPLE=aarch64-linux-gnu-
$	export CROSS_COMPILE=aarch64-linux-android-
$	export CROSS_COMPILE_ARM32=arm-linux-androideabi-

ARCH & SUBARCH according to your device.

  1. Use these command for compiling with AOSP clang.
$ make \
	O=out \
	clean \
	mrproper \
	CC=clang \
	AR=llvm-ar \
	NM=llvm-nm \
	OBJCOPY=llvm-objcopy \
	OBJDUMP=llvm-objdump \
	READELF=llvm-readelf \
	OBJSIZE=llvm-size \
	STRIP=llvm-strip \
	HOSTCC=clang \
	HOSTCXX=clang++ \
	${DEVICE}_defconfig
  
$ make \
	O=out \
	CC=clang \
	AR=llvm-ar \
	NM=llvm-nm \
	OBJCOPY=llvm-objcopy \
	OBJDUMP=llvm-objdump \
	READELF=llvm-readelf \
	OBJSIZE=llvm-size \
	STRIP=llvm-strip \
	HOSTCC=clang \
	HOSTCXX=clang++ \
	-j$(nproc --all)

{DEVICE}_defconfig is the kernel config file used to compile kernel. Kernel binaries will be produced in out directory.

For using Snapdragon clang:

  1. Set path for the toolchain.
$	PATH="$TOP/tools/sdclang/linux-x86_64/bin:$PATH"
  1. Export required flags.
$	export ARCH=arm64
$	export SUBARCH=ARM64
$	export CROSS_COMPILE=aarch64-linux-gnu-
$	export CROSS_COMPILE_ARM32=arm-linux-gnueabi-

ARCH & SUBARCH according to your device.

  1. Use these command for compiling with Snapdragon clang.
$ make \
	O=out \
	clean \
	mrproper \    
	CC=clang \
	${DEVICE}_defconfig
    
$ make \
	O=out \    
	CC=clang \
	-j$(nproc --all)

{DEVICE}_defconfig is the kernel config file used to compile kernel. Kernel binaries will be produced in out directory.


# 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.

AOSP clang is taken from : Android Open Source Project.
Snapdragon clang is taken from : developer.qualcomm.com.
Give a star if you liked my work.

android-kernel-tools's People

Contributors

pkm774 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.