summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorStephen Arnold <stephen.arnold42@gmail.com>2017-02-12 18:25:27 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-14 07:55:53 -0700
commit1118ff07f4ee96d481e4a062a2cbf2c9d60f451d (patch)
treeb65f019974f55166973958d1853a29062de06762 /meta/recipes-devtools/gcc
parentd80d10b4d4c7f3c8bcc3339fa4b029685039c2e2 (diff)
downloadpoky-1118ff07f4ee96d481e4a062a2cbf2c9d60f451d.tar.gz
gcc-6: Add fix for missing no-PIE flags
Fixes build on hardened PAX host with gcc-5 (linker error on relocs). Completes no-PIE config by adding to ALL_* flags variables. Borrowed from Gentoo gcc patches, tested on 2 hardened amd64 hosts. Upstream-Status: Inappropriate [configuration] Commited by: Gentoo Toolchain Project <toolchain@gentoo.org> (From OE-Core rev: c178791cd78d5a9ebc4d7b7790e647a9bafe9cf2) (From OE-Core rev: e54f26a0dbfc8de22ce8326ac77d1097d13f6e2c) Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fcb236ea7cd1ac052719187fefed60ebf1a30ac8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-6.3.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch22
2 files changed, 23 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-6.3.inc b/meta/recipes-devtools/gcc/gcc-6.3.inc
index 7cf25ab1b6..4f04c012c1 100644
--- a/meta/recipes-devtools/gcc/gcc-6.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-6.3.inc
@@ -79,6 +79,7 @@ SRC_URI = "\
79 file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ 79 file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
80 file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \ 80 file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
81 file://0048-sync-gcc-stddef.h-with-musl.patch \ 81 file://0048-sync-gcc-stddef.h-with-musl.patch \
82 file://0054_all_nopie-all-flags.patch \
82 ${BACKPORTS} \ 83 ${BACKPORTS} \
83" 84"
84BACKPORTS = "\ 85BACKPORTS = "\
diff --git a/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch b/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch
new file mode 100644
index 0000000000..73ab9502dc
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch
@@ -0,0 +1,22 @@
1Need to pass NO_PIE_CFLAGS to ALL_* so gcc doesn't fail when
2we compile it with older gcc and pie.
3
4Upstream-Status: Inappropriate [configuration]
5
6Maintained by: Gentoo Toolchain Project <toolchain@gentoo.org>
7Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com>
8
9--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200
10+++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200
11@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
12 ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
13
14 # This is the variable to use when using $(COMPILER).
15-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
16+ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
17
18 # This is the variable to use when using $(LINKER).
19-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
20+ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
21
22 # Build and host support libraries.