summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-09-14 15:08:54 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-09-19 22:01:56 +1000
commit6977f95e63b9b3fb4a5973481a800dd9f48a1338 (patch)
treea36fdfab44462fe31d77d2db7f44217a1960527b /arch/powerpc/Makefile
parent2a056f58fd33ccc6a0261b552b0f17e7fa4a12f3 (diff)
downloadlinux-6977f95e63b9b3fb4a5973481a800dd9f48a1338.tar.gz
linux-6977f95e63b9b3fb4a5973481a800dd9f48a1338.tar.bz2
linux-6977f95e63b9b3fb4a5973481a800dd9f48a1338.zip
powerpc: avoid -mno-sched-epilog on GCC 4.9 and newer
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index be47cf8a0798..07d9dce7eda6 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -165,8 +165,12 @@ CC_FLAGS_FTRACE := -pg
ifdef CONFIG_MPROFILE_KERNEL
CC_FLAGS_FTRACE += -mprofile-kernel
endif
-# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
-CC_FLAGS_FTRACE += -mno-sched-epilog
+# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828
+ifneq ($(cc-name),clang)
+CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog)
+endif
endif
CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))