mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
scripts/kernel-functions: Fix -fno-PIE backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8007 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -321,7 +321,7 @@ index d6d65537b0d9..6aad8308a0ac 100644
|
||||
EOF
|
||||
fi
|
||||
case "$1" in
|
||||
3.19.*|4.[023567].*)
|
||||
3.[0-9].*|3.1[01345].*|3.17.*|3.19.*|4.[023567].*)
|
||||
patch -p1 <<'EOF'
|
||||
From c6a385539175ebc603da53aafb7753d39089f32e Mon Sep 17 00:00:00 2001
|
||||
From: Borislav Petkov <bp@suse.de>
|
||||
@@ -355,67 +355,30 @@ Cc: stable@vger.kernel.org
|
||||
Cc: Ben Hutchings <ben@decadent.org.uk>
|
||||
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: Michal Marek <mmarek@suse.com>
|
||||
[ bvanassche: moved -fno-PIE to start of KBUILD_CFLAGS ]
|
||||
---
|
||||
Makefile | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 58fc5d935ce6..77ac3f88ec37 100644
|
||||
index 0ed6ce300543..c324b43712f0 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -399,11 +399,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
@@ -378,7 +378,8 @@ LINUXINCLUDE := \
|
||||
|
||||
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 \
|
||||
- -std=gnu89
|
||||
+ -std=gnu89 $(call cc-option,-fno-PIE)
|
||||
+
|
||||
@@ -387,7 +388,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
-KBUILD_AFLAGS := -D__ASSEMBLY__
|
||||
+KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
|
||||
KBUILD_AFLAGS_MODULE := -DMODULE
|
||||
KBUILD_CFLAGS_MODULE := -DMODULE
|
||||
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
|
||||
EOF
|
||||
;;
|
||||
3.17.*)
|
||||
patch -p1 <<'EOF'
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 656f0b0cff53..82c569c05d18 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -407,11 +407,11 @@ KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration \
|
||||
- -Wno-format-security
|
||||
+ -Wno-format-security $(call cc-option,-fno-PIE)
|
||||
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
-KBUILD_AFLAGS := -D__ASSEMBLY__
|
||||
+KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
|
||||
KBUILD_AFLAGS_MODULE := -DMODULE
|
||||
KBUILD_CFLAGS_MODULE := -DMODULE
|
||||
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
|
||||
EOF
|
||||
;;
|
||||
3.[0-9].*|3.1[01345].*)
|
||||
patch -p1 <<'EOF'
|
||||
--- linux-3.15/Makefile.orig 2019-02-28 19:10:25.026779069 +0100
|
||||
+++ linux-3.15/Makefile 2019-02-28 19:12:04.532860857 +0100
|
||||
@@ -395,11 +395,11 @@
|
||||
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration \
|
||||
- -Wno-format-security \
|
||||
+ -Wno-format-security $(call cc-option,-fno-PIE)\
|
||||
$(call cc-option,-fno-delete-null-pointer-checks,)
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
-KBUILD_AFLAGS := -D__ASSEMBLY__
|
||||
+KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
|
||||
KBUILD_AFLAGS_MODULE := -DMODULE
|
||||
KBUILD_CFLAGS_MODULE := -DMODULE
|
||||
|
||||
Reference in New Issue
Block a user