[Samsung Galaxy Nexus] MBQ_:
Here's how to set up linaro, make it use -O3, and use CCACHE:

1st:

sudo gedit ~/.bashrc

2nd:

at the very bottom, insert:

export PATH=${PATH}:/path/to/your/bin
export USE_CCACHE=1
export CCACHE_DIR=/path/to/your/ccache
export CCACHE_LOGFILE=/path/to/your/ccache/ccache.log

3rd:

sudo -i

then:

repo sync -f -j8 ( or # of cores x2)

(If you get checkout errors, simply cd to your directory and

git stash

it

4th:

cd to your Xylon source, then:

. build/envsetup.sh
croot
brunch toroplus -j8

(or # of your cores x2, I have 4 cores but use -j32)

if you want to watch CCACHE to make sure it's working, cd to:

/path/to/your/XYAOSP/prebuilts/misc/linux-x86/cache

then:

ccache -s

to change the size of your CCACHE, cd to:

/path/to/your/XYAOSP/prebuilts/misc/linux-x86

then:

ccache -M 20

(20=20GB, you can set it all the way to 100)

make sure ccache is getting hits. (The first build will take way longer than usual, so be patient). :)

to call linaro out correctly, open your xylon folder, go to build, and edit envsetup.sh (if you see a lock on the file(s), enter this:

sudo chmod -R 777 /path/to/your/XYAOSP/build

then, find:

# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-4.6/bin
;;
arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;

and change:

arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin

to:

arm) toolchaindir=linaro/bin

and:

unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-$targetgccversion/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
;;
mips) toolchaindir=mips/mips-eabi-4.4.3/bin
;;
*)
# No need to set ARM_EABI_TOOLCHAIN for other ARCHs
;;

change:

case $ARCH in
arm)
toolchaindir=arm/arm-eabi-$targetgccversion/bin

to:

case $ARCH in
arm)
toolchaindir=linaro/bin

(Make sure linaro is in

/path/to/your/XYAOSP/prebuilts/gcc/linux-x86/linaro

)

to enable -O3 optimizations, go to:

/path/to/your/XYAOSP/build/core/combo

open: select.mk

edit:

ifneq ($(TARGET_USE_02),true)
$(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
$(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
else
$(combo_target)GLOBAL_CFLAGS := -O3 -g -Wstrict-aliasing=2
ifneq ($(combo_target),HOST_)
(combo_target)RELEASE_CFLAGS += -Werror=strict-aliasing
endif
endif
$(combo_target)GLOBAL_LDFLAGS := -Wl,-O3
$(combo_target)GLOBAL_ARFLAGS := crsP

change anything -O2 to -O3

save it

then: go to the build/core/combo

then: TARGET_linux-arm.mk

change:

ifeq ($(TARGET_USE_O3),true)
TARGET_arm_CFLAGS := -Os \
-fomit-frame-pointer \
-fstrict-aliasing \
-fno-tree-vectorize
else
TARGET_arm_CFLAGS := -O3 \
-fomit-frame-pointer \
-fstrict-aliasing \
-funswitch-loops
endif

to:

ifeq ($(TARGET_USE_O2),true)
TARGET_arm_CFLAGS := -Os \
-fomit-frame-pointer \
-fstrict-aliasing \
-fno-tree-vectorize
else
TARGET_arm_CFLAGS := -O3 \
-fomit-frame-pointer \
-fstrict-aliasing \
-funswitch-loops
endif

and:

ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
ifeq ($(TARGET_USE_O2),true)
TARGET_thumb_CFLAGS := -mthumb \
-O2 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
else
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
endif
else
TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS)
endif

to:

ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
ifeq ($(TARGET_USE_O3),true)
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
else
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
endif
else
TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS)
endif

^^ Make any of these changes

prior

to building

Did that mostly from memory, hope I didnt mess anything up. Hahaha

Hope I helped!! Tried to make this as clear as day for you. :)