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). https://github.com/Decatf/android_kernel_samsung_p4/blob/bd0772df2132bf56cda78e7204facf434cd5aa40/include/linux/compiler-gcc.h
30 lines
821 B
Bash
30 lines
821 B
Bash
#!/bin/sh
|
|
srcdir=$1
|
|
builddir=$2
|
|
_config=$3
|
|
_carch=$4
|
|
HOSTCC=$5
|
|
|
|
if [ -z "$srcdir" ] || [ -z "$builddir" ] || [ -z "$_config" ] ||
|
|
[ -z "$_carch" ] || [ -z "$HOSTCC" ]; then
|
|
echo "ERROR: missing argument!"
|
|
echo "Please call downstreamkernel_prepare() with \$srcdir, \$builddir,"
|
|
echo "\$_config, \$_carch and \$HOSTCC as arguments."
|
|
exit 1
|
|
fi
|
|
|
|
# support newer GCC versions
|
|
cp -v "/usr/share/devicepkg-dev/compiler-gcc.h" "$builddir/include/linux/"
|
|
|
|
# Remove -Werror from all makefiles
|
|
makefiles="$(find . -type f -name Makefile)
|
|
$(find . -type f -name Kbuild)"
|
|
for i in $makefiles; do
|
|
sed -i 's/-Werror-/-W/g' "$i"
|
|
sed -i 's/-Werror//g' "$i"
|
|
done
|
|
|
|
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
|
|
cp "$srcdir/$_config" "$builddir"/.config
|
|
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
|