Skip to content

Instantly share code, notes, and snippets.

@miwong
Forked from nethunteros/setupenv
Created March 22, 2018 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miwong/0d0c3bd453d4cf9e9962638b4dd31cd0 to your computer and use it in GitHub Desktop.
Save miwong/0d0c3bd453d4cf9e9962638b4dd31cd0 to your computer and use it in GitHub Desktop.
Easily select toolchain between 64bit and 32 bit kernel builds for Android
#/bin/bash
#
# Download toolschains:
# git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7 toolchain
# git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b marshmallow-release toolchain64
#
# Instructions to set toolchain for build:
# source setupenv 64
case "$1" in
"32")
echo "Setting build architecture to 32 bit (arm)"
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=`pwd`/toolchain/bin/arm-eabi-
;;
"64")
echo "Setting build architecture to 64 bit (arm64)"
export ARCH=arm64
export SUBARCH=arm64
export CROSS_COMPILE=`pwd`/toolchain64/bin/aarch64-linux-android-
;;
*)
echo "Pass either 32 or 64 bit"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment