cd -
}
+list_gccs() {
+ local gccs
+ gccs=()
+ IFS=: read -r -a path_array <<< "$PATH"
+ while read -r gcc ; do
+ gccs+=("$gcc")
+ done < <(find "${path_array[@]}" -maxdepth 1 -regex '.*/gcc-[0-9\.]+$' -printf '%f\n' | sort -t- -k2 -V -r)
+ echo "${gccs[@]}"
+}
+
# Find the most recent GCC version supported by the kernel sources
select_compiler() {
local selected_cc
set +e
- for cc in gcc-8 gcc-5 gcc-4.8; do
+ for cc in $(list_gccs) ; do
if "${CROSS_COMPILE:-}${cc}" -I include/ -D__LINUX_COMPILER_H -D__LINUX_COMPILER_TYPES_H -E include/linux/compiler-gcc.h; then
selected_cc="$cc"
break
scripts/config --disable CONFIG_IGBVF
fi
+ # Don't fail the build on warnings
+ scripts/config --disable CONFIG_WERROR
+
# Set required options
scripts/config --enable CONFIG_TRACEPOINTS
scripts/config --enable CONFIG_KALLSYMS
scripts/config --enable CONFIG_EVENT_TRACING
scripts/config --enable CONFIG_KRETPROBES
+ # FIXME: disable objtool on vmlinux, it OOMs on allyesconfig
+ sed -i 's/objtool_link vmlinux.o//' scripts/link-vmlinux.sh || true
+ # Starting with v6.1-rc6
+ sed -i 's/^objtool-enabled := .*/objtool-enabled := /' scripts/Makefile.vmlinux_o || true
+
+ # Disable SORTTAB
+ sed -i 's/is_enabled CONFIG_BUILDTIME_TABLE_SORT/is_enabled CONFIG_NONEXISTANT/' scripts/link-vmlinux.sh || true
+
# Debug
#cat .config
touch -r "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/generated/autoconf.h"
# Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
- cp "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/config/auto.conf"
+ if [ ! -f "${LINUX_HDROBJ_DIR}/include/config/auto.conf" ]; then
+ cp "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/config/auto.conf"
+ fi
# Finally clean the object files from the full source tree
make clean