summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2020-12-15 08:34:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 11:45:47 +0000
commitbd166d6318a2c575a0ad0f1ac4ccc7eef848eadd (patch)
tree1edd9350f2fff3087ac1d1a210c502c81370bde3 /meta/recipes-devtools
parent6de89a57c44ddd0ce78ff1b9bd3fc2dbbe7e83cc (diff)
downloadpoky-bd166d6318a2c575a0ad0f1ac4ccc7eef848eadd.tar.gz
gcc: Add patch to resolve i*86 tune configuration overrides
When compiling gcc-runtime for i686 libatomic, libgomp and libitm are compiled with additional '-march' and '-mtune' overrides. This typically does not cause build errors (e.g. core2-32 tune), and results in less optimally tuned outputs. However with specific TUNE_CCARGS (e.g. has '-mfpmath=sse' but not '-msse*'), the build errors with conflicting '-mfpmath' options. This is caused by gcc-runtime specific configure scripts and Makefile options that override by adding additional '-march'/'-mtune' args. OE builds gcc-runtime differently to other build systems, and provides target specific arch/tune options directly. As such, this change adds a patch for gcc to remove the specific cases where the args are added. (From OE-Core rev: 5ce0102ca75754f0a7c777505678677cdf2a62bc) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d39b686cc5fcc89405ffeb560ea64b5d305b0608) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gcc/gcc-10.2.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc/0001-lib-Remove-i-86-march-overrides.patch113
2 files changed, 114 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc b/meta/recipes-devtools/gcc/gcc-10.2.inc
index 7625af5110..87dc988d70 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
@@ -69,6 +69,7 @@ SRC_URI = "\
69 file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \ 69 file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \
70 file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \ 70 file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
71 file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch \ 71 file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch \
72 file://0001-lib-Remove-i-86-march-overrides.patch \
72" 73"
73SRC_URI[sha256sum] = "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c" 74SRC_URI[sha256sum] = "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
74 75
diff --git a/meta/recipes-devtools/gcc/gcc/0001-lib-Remove-i-86-march-overrides.patch b/meta/recipes-devtools/gcc/gcc/0001-lib-Remove-i-86-march-overrides.patch
new file mode 100644
index 0000000000..3f04e121ba
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0001-lib-Remove-i-86-march-overrides.patch
@@ -0,0 +1,113 @@
1From 3776789cde95916f95deef48acf9532b0ebf91ae Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Tue, 15 Dec 2020 11:43:36 +1000
4Subject: [PATCH] lib*: Remove i*86 march overrides
5
6OE does not pass the '--with-arch' option to gccs configure, as such
7some gcc-runtime libraries try to override the value of '-march' and
8'-mtune' which OE already provides. This causes conflicts with other
9i*86 instruction/architecture flags (e.g. -msse* and -mfpmath=*).
10Additionally this caused the following libraries to be built with less
11optimized tune configurations.
12
13Upstream suggests that this should be detecting or otherwise checking if
14the target supports the desired functionality before overriding.
15
16 https://gcc.gnu.org/legacy-ml/gcc-patches/2016-04/msg01344.html
17
18libatomic also overrides the '-march' specifically for IFUNC objects.
19OE already supplies the correct march flag, so remove setting.
20
21Upstream-Status: Inappropriate [OE Specific]
22Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
23---
24 libatomic/Makefile.am | 1 -
25 libatomic/Makefile.in | 1 -
26 libatomic/configure.tgt | 9 ---------
27 libgomp/configure.tgt | 8 --------
28 libitm/configure.tgt | 9 ---------
29 5 files changed, 28 deletions(-)
30
31diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
32index ac1ca64587..5aa16e0699 100644
33--- a/libatomic/Makefile.am
34+++ b/libatomic/Makefile.am
35@@ -133,7 +133,6 @@ libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS))
36 libatomic_la_LIBADD += $(addsuffix _8_2_.lo,$(SIZEOBJS))
37 endif
38 if ARCH_I386
39-IFUNC_OPTIONS = -march=i586
40 libatomic_la_LIBADD += $(addsuffix _8_1_.lo,$(SIZEOBJS))
41 endif
42 if ARCH_X86_64
43diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
44index 97df2d7ff0..82c511d420 100644
45--- a/libatomic/Makefile.in
46+++ b/libatomic/Makefile.in
47@@ -432,7 +432,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \
48 _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \
49 $(am__append_3) $(am__append_4)
50 @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64
51-@ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586
52 @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16
53 libatomic_convenience_la_SOURCES = $(libatomic_la_SOURCES)
54 libatomic_convenience_la_LIBADD = $(libatomic_la_LIBADD)
55diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
56index 5dd0926d20..3cc41773c3 100644
57--- a/libatomic/configure.tgt
58+++ b/libatomic/configure.tgt
59@@ -82,15 +82,6 @@ case "${target_cpu}" in
60 ;;
61
62 i[3456]86)
63- case " ${CC} ${CFLAGS} " in
64- *" -m64 "*|*" -mx32 "*)
65- ;;
66- *)
67- if test -z "$with_arch"; then
68- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
69- XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
70- fi
71- esac
72 ARCH=x86
73 # ??? Detect when -march=i686 is already enabled.
74 try_ifunc=yes
75diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
76index 4790a31e39..46c4c958e6 100644
77--- a/libgomp/configure.tgt
78+++ b/libgomp/configure.tgt
79@@ -72,14 +72,6 @@ if test x$enable_linux_futex = xyes; then
80 # Note that bare i386 is not included here. We need cmpxchg.
81 i[456]86-*-linux*)
82 config_path="linux/x86 linux posix"
83- case " ${CC} ${CFLAGS} " in
84- *" -m64 "*|*" -mx32 "*)
85- ;;
86- *)
87- if test -z "$with_arch"; then
88- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
89- fi
90- esac
91 ;;
92
93 # Similar jiggery-pokery for x86_64 multilibs, except here we
94diff --git a/libitm/configure.tgt b/libitm/configure.tgt
95index 04109160e9..3d78ea609d 100644
96--- a/libitm/configure.tgt
97+++ b/libitm/configure.tgt
98@@ -59,15 +59,6 @@ case "${target_cpu}" in
99 arm*) ARCH=arm ;;
100
101 i[3456]86)
102- case " ${CC} ${CFLAGS} " in
103- *" -m64 "*|*" -mx32 "*)
104- ;;
105- *)
106- if test -z "$with_arch"; then
107- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
108- XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
109- fi
110- esac
111 XCFLAGS="${XCFLAGS} -mrtm"
112 ARCH=x86
113 ;;