+ if ( { vergte "${kversion}" "4.4"; } && { verlt "${kversion}" "4.4.136"; } ) ||
+ ( { vergte "${kversion}" "4.5"; } && { verlt "${kversion}" "4.8"; } ); then
+ # Hacky patch to deal with the following build error:
+ # Cannot find symbol for section 7: .text.unlikely.
+ # kernel/kexec_file.o: failed
+ # make[1]: *** [scripts/Makefile.build:291: kernel/kexec_file.o] Error 1
+ #
+ # This error happens with binutils 2.36 and 2.37, but should probably not
+ # be an issue with binutils 2.38.
+ # @see https://github.com/linuxppc/issues/issues/388
+ # @see https://github.com/bminor/binutils-gdb/commit/c09c8b42021180eee9495bd50d8b35e683d3901b
+ #
+ # There is some sort of config (unspecified in past discussions) which
+ # provokes the error, and there was never a potential fix merged in
+ # this discussion, in part because the build systems of the kernel
+ # switched to objtool instead.
+ #
+ # @see https://lore.kernel.org/all/20210215162209.5e2a475b@gandalf.local.home/
+ #
+ sed -i 's/return txtname;/return shdr0->sh_size ? txtname : NULL;/' scripts/recordmcount.h
+
+ # After applying the above patch, the build continues but fails with
+ # head64.c:(.text.exit+0x5): undefined reference to `__gcov_exit'
+ #
+ scripts/config --disable CONFIG_GCOV_KERNEL
+ fi
+
+ if { vergte "${kversion}" "4.5"; } && { verlt "${kversion}" "4.5.5"; } ; then
+ # drivers/staging/wilc1000/wilc_spi.c:123:34: error: storage size of ‘wilc1000_spi_ops’ isn’t known
+ patch_linux_kernel ce7b516f3f9e11fe4ee06fad0d7e853bb6e8f160
+ fi
+