summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-common.inc
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2015-11-02 08:52:28 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-12 08:42:31 +0000
commitb1e980f33bfa259f886c1ae6eaa28ab40120d0a1 (patch)
treee24e4cfc37dc27bb02872784a9fdca34d08c5266 /meta/recipes-devtools/gcc/gcc-common.inc
parented8269010c70bb4d3ee6ace94c83abe3dfbe23c7 (diff)
downloadpoky-b1e980f33bfa259f886c1ae6eaa28ab40120d0a1.tar.gz
gcc: Update default Power GCC settings to use secure-plt
The gcc default, bss-plt, will cause errors when using the prelinker. All other distributions that I am aware of are using the the secure-plt. For an explanation of the differences, the gcc docs: Current PowerPC GCC accepts a `-msecure-plt' option that generates code capable of using a newer PLT and GOT layout that has the security advantage of no executable section ever needing to be writable and no writable section ever being executable. PowerPC ld will generate this layout, including stubs to access the PLT, if all input files (including startup and static libraries) were compiled with `-msecure-plt'. `--bss-plt' forces the old BSS PLT (and GOT layout) which can give slightly better performance. The security of the new PLT and ability to run the prelinker outweigh any performance penalty. The secure-plt is enabled by default. The old bss-plt can be enabled by selecting 'bssplt' in the DISTRO_FEATURES. (From OE-Core master rev: 70c55aada1101a5c687cdaa79f370fa4530b39d9) (From OE-Core rev: 44adc575be5d9b9ad0d87e143467aeeadde2fe89) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index d63c07f68a..6f2f224a14 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -25,6 +25,11 @@ def get_gcc_mips_plt_setting(bb, d):
25 return "--with-mips-plt" 25 return "--with-mips-plt"
26 return "" 26 return ""
27 27
28def get_gcc_ppc_plt_settings(bb, d):
29 if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
30 return "--enable-secureplt"
31 return ""
32
28def get_long_double_setting(bb, d): 33def get_long_double_setting(bb, d):
29 if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]: 34 if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
30 return "--with-long-double-128" 35 return "--with-long-double-128"