From 041ef552478cf79e6ec70bc7c25fd91c258fc696 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 13 May 2020 21:27:11 +0000 Subject: [PATCH] scripts/kernel-functions: Fix the RHEL 6.x build git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8909 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/kernel-functions | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 0a7bc0d63..a3d02137d 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -402,8 +402,31 @@ index 0ed6ce300543..c324b43712f0 100644 KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds EOF ;; - # The patch below does not apply on the CentOS 6 kernel. + # CentOS 6.x. 2.6.32-*) + patch -p1 <<'EOF' +--- linux-2.6.32-754.29.1.el6/Makefile.orig 2020-05-13 14:09:18.448503420 -0700 ++++ linux-2.6.32-754.29.1.el6/Makefile 2020-05-13 14:11:24.265441790 -0700 +@@ -355,7 +355,8 @@ + + KBUILD_CPPFLAGS := -D__KERNEL__ + +-KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ ++KBUILD_CFLAGS := $(call cc-option,-fno-PIE) \ ++ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -fno-common \ + -Werror-implicit-function-declaration \ + -Wno-format-security \ +@@ -380,7 +381,7 @@ + endif ##($(KBUILD_EXTMOD),) + endif #(,$(filter $(ARCH), i386 x86_64)) + +-KBUILD_AFLAGS := -D__ASSEMBLY__ ++KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) + + # Read KERNELRELEASE from include/config/kernel.release (if it exists) + KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) +EOF ;; 2.6.3[1-5]*) patch -p1 <<'EOF'