forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0130-add-workaround-for-binutils-optimization.patch
More file actions
60 lines (50 loc) · 2.68 KB
/
0130-add-workaround-for-binutils-optimization.patch
File metadata and controls
60 lines (50 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
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 083a97af538c..6222e47f8030 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)
@@ -195,8 +195,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)
@@ -208,6 +208,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
# Workaround for a gcc prelease that unfortunately was shipped in a suse release
KBUILD_CFLAGS += -Wno-sign-compare
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 6b84afdd7538..93ba779c2cd9 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