HOSTCC defaults to gcc, so we should only set it to override it
if we want to use an older GCC. Removing it avoids annoying linter
warnings caused by the HOSTCC="..." variable assignments.
Instead of never overwriting compiler-gcc.h if it exists, overwrite it
by default except if OVERWRITE_GCCH=0 is set in the environment.
Most kernels *do* need this file replaced and won't build without this
patch.
The 5.0 kernel now includes -Werror= parameters in the makefile, this
changes downstreamkernel_prepare.sh to support them. Without this, the
script will replace, for example, -Werror=blah with =blah, which causes
the kernel compilation to fail.
We used to put a "compiler-gcc6.h" file inside every vendor kernel's
aport. This is redundant and only works with GCC6. With this patch,
a common "compiler-gcc.h" file will be used, that works independently
of the GCC version.
The file is from Decatf's android_kernel_samsung_p4 repository, where
it was taken from upstream Linux, but adjusted to work with older
vendor kernels (different #ifndef check at the top etc).
bd0772df21/include/linux/compiler-gcc.h