add workaround for binutils optimization

This commit is contained in:
Miguel Bernal Marin 2019-11-06 16:36:15 -06:00
parent d9479983cb
commit 951e42ac3d
3 changed files with 64 additions and 2 deletions

View File

@ -0,0 +1,60 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Wed, 6 Nov 2019 04:03:04 +0000
Subject: [PATCH] add workaround for binutils optimization
---
arch/x86/Makefile | 9 ++++++---
arch/x86/boot/compressed/Makefile | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 65e5205..7cc0aad 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -58,7 +58,7 @@ endif
#
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
#
-KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
+KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wa,-mbranches-within-no-boundaries
KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
ifeq ($(CONFIG_X86_32),y)
@@ -201,8 +201,8 @@ avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1)
sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1)
sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1)
-KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
-KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr)
+KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) -Wa,-mbranches-within-no-boundaries
+KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) -Wa,-mbranches-within-no-boundaries
KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
@@ -214,6 +214,9 @@ KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
ifdef CONFIG_X86_64
KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
endif
+ifdef CONFIG_X86_64
+KBUILD_LDFLAGS += $(call ld-option, -mbranches-within-no-boundaries)
+endif
# Speed up the build
KBUILD_CFLAGS += -pipe
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 466f66c..3eea18f 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -39,7 +39,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
KBUILD_CFLAGS += -Wno-pointer-sign
-KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ -Wa,-mbranches-within-no-boundaries
GCOV_PROFILE := n
UBSAN_SANITIZE :=n
--
https://clearlinux.org

View File

@ -18,7 +18,7 @@ Version: 4.19.78
# upstream number is the number from PKT it consist in
# YYMMDDHHMM a 10 length number
%global upstreamnumber 1903221317
Release: 95
Release: 96
License: GPL-2.0
Summary: The Linux kernel
Url: http://www.kernel.org/
@ -1236,6 +1236,7 @@ Patch1180: 1180-ASoC-Intel-Skylake-Recover-BXT-FW-on-DSP-boot-timeou.patch
# Clear Linux Series
Patch9001: 9001-init-wait-for-partition-and-retry-scan.patch
Patch9002: 9002-Add-boot-option-to-allow-unsigned-modules.patch
Patch9003: 9003-add-workaround-for-binutils-optimization.patch
%description
The Linux IOT LTS2018 kernel.
@ -2483,6 +2484,7 @@ Linux kernel build files and install script
# Clear Linux Series
%patch9001 -p1
%patch9002 -p1
%patch9003 -p1
cp %{SOURCE1} .
cp %{SOURCE2} .

View File

@ -1 +1 @@
95
96