Skip to content

Instantly share code, notes, and snippets.

@nethunteros
Created January 1, 2017 15:17
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save nethunteros/1582b00379f736328f7d1b5d86559411 to your computer and use it in GitHub Desktop.
Save nethunteros/1582b00379f736328f7d1b5d86559411 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