envkernel: Set CC and HOSTCC (!1733)

It is necessary to override these environment variables to use an alternate
compiler such as gcc6.
This commit is contained in:
Robert Yang 2018-12-29 13:54:07 -05:00
parent 70126570a4
commit ce57fae12d
1 changed files with 5 additions and 0 deletions

View File

@ -155,8 +155,12 @@ set_alias_make() {
esac
if [ "$gcc6_arg" = "1" ]; then
cc="gcc6-${prefix}-gcc"
hostcc="gcc6-gcc"
cross_compiler="/usr/bin/gcc6-$prefix-"
else
cc="${prefix}-gcc"
hostcc="gcc"
cross_compiler="/usr/bin/$prefix-"
fi
@ -166,6 +170,7 @@ set_alias_make() {
cmd="$cmd ARCH=$arch"
cmd="$cmd CROSS_COMPILE=$cross_compiler"
cmd="$cmd make -C /mnt/linux O=/mnt/linux/.output"
cmd="$cmd CC=$cc HOSTCC=$hostcc"
# shellcheck disable=SC2139
alias make="$cmd"
}