From 9383502e95c266f66d2af15584499e4560a6c6c9 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 1 Sep 2023 11:59:05 -0400 Subject: [PATCH] jjb: lttng-modules: many kernel build fixes Change-Id: I3f7a0601c543e4f4a37fe29fd538c3299661e7f2 Signed-off-by: Michael Jeanson --- scripts/lttng-modules/param-build.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/lttng-modules/param-build.sh b/scripts/lttng-modules/param-build.sh index 5ffffd2..3a1a930 100644 --- a/scripts/lttng-modules/param-build.sh +++ b/scripts/lttng-modules/param-build.sh @@ -330,7 +330,7 @@ build_linux_kernel() { fi fi - if { vergt "${selected_cc_version}" "7"; } && { vergte "${kversion}" "4.15"; } && { verlt "${kversion}" "4.17"; } ; then + if { vergt "${selected_cc_version}" "7"; } && { vergte "${kversion}" "4.14"; } && { verlt "${kversion}" "4.17"; } ; then # Builds fail due to -Werror=restrict in pager.o and str_error_r.o if { verlt "${kversion}" "4.16"; } ; then # This is patched since objtool's Makefile doesn't respect HOSTCFLAGS @@ -383,6 +383,17 @@ build_linux_kernel() { # Some old kernels fail to build when make is too new # @see https://gitlab.com/linux-kernel/stable/-/commit/9feeb638cde083c737e295c0547f1b4f28e99583 patch_linux_kernel 9564a8cf422d7b58f6e857e3546d346fa970191e + fi + + if { vergte "${kversion}" "4.14"; } && { verlt "${kversion}" "4.14.55"; } ; then + # Some old kernels fail to build when make is too new + # @see https://gitlab.com/linux-kernel/stable/-/commit/9feeb638cde083c737e295c0547f1b4f28e99583 + patch_linux_kernel e82885490a611f2b75a6c27cd7bb09665c1740be + fi + + if ( { vergte "${kversion}" "4.15"; } && { verlt "${kversion}" "4.18"; } ) || \ + ( { vergte "${kversion}" "4.14"; } && { verlt "${kversion}" "4.14.56"; } ) ; then + # Some old kernels fail to build when make is too new # @see https://gitlab.com/linux-kernel/stable/-/commit/9feeb638cde083c737e295c0547f1b4f28e99583 patch_linux_kernel 9feeb638cde083c737e295c0547f1b4f28e99583 fi @@ -543,6 +554,17 @@ EOF patch_linux_kernel 8a522bf2d4f788306443d36b26b54f0aedcdfdbe fi + if ( { vergte "${kversion}" "4.15"; } && { verlt "${kversion}" "4.15.2"; } ) || \ + ( { vergte "${kversion}" "4.14"; } && { verlt "${kversion}" "4.14.18"; } ) ; then + # Fix an objtool Segmentation fault + patch_linux_kernel dd12561854824fd1f05baf2a1b794faa046e2425 + fi + + if { vergte "${kversion}" "4.14"; } && { verlt "${kversion}" "4.14.268"; } ; then + # Builds fail due to -Werror=use-after-free in sigchain.o and help.o + patch_linux_kernel e89bb266b710ce056f141f29f091fd468a4a8185 + fi + # Fix a typo in v2.6.36.x if [ -f "arch/x86/kernel/entry_64.S" ]; then sed -i 's/END(do_hypervisor_callback)/END(xen_do_hypervisor_callback)/' arch/x86/kernel/entry_64.S -- 2.34.1