From f0716643b41aaff6ba37ea629ccead7b2011f618 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 18 Feb 2017 18:16:25 -0800 Subject: [PATCH] Garbage collection for GCC options that are same ... on all supported versions. Signed-off-by: Alexey Neyman --- config/cc/gcc.in | 80 ------------------------------------- config/cc/gcc.in.2 | 26 ++++++++---- scripts/build/cc/100-gcc.sh | 22 +++++----- 3 files changed, 29 insertions(+), 99 deletions(-) diff --git a/config/cc/gcc.in b/config/cc/gcc.in index c1996e91..99bd3d28 100644 --- a/config/cc/gcc.in +++ b/config/cc/gcc.in @@ -130,11 +130,6 @@ config CC_GCC_4_8 select CC_GCC_4_8_or_later select CC_GCC_USE_GMP_MPFR select CC_GCC_USE_MPC - select CC_GCC_HAS_GRAPHITE - select CC_GCC_HAS_LTO - select CC_GCC_HAS_PKGVERSION_BUGURL - select CC_GCC_HAS_BUILD_ID - select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER select CC_SUPPORT_GOLANG @@ -147,11 +142,6 @@ config CC_GCC_4_9 select CC_GCC_4_9_or_later select CC_GCC_USE_GMP_MPFR select CC_GCC_USE_MPC - select CC_GCC_HAS_GRAPHITE - select CC_GCC_HAS_LTO - select CC_GCC_HAS_PKGVERSION_BUGURL - select CC_GCC_HAS_BUILD_ID - select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER select CC_SUPPORT_GOLANG @@ -165,11 +155,6 @@ config CC_GCC_5 select CC_GCC_5_or_later select CC_GCC_USE_GMP_MPFR select CC_GCC_USE_MPC - select CC_GCC_HAS_GRAPHITE - select CC_GCC_HAS_LTO - select CC_GCC_HAS_PKGVERSION_BUGURL - select CC_GCC_HAS_BUILD_ID - select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER select CC_GCC_HAS_LIBMPX @@ -184,11 +169,6 @@ config CC_GCC_6 select CC_GCC_6_or_later select CC_GCC_USE_GMP_MPFR select CC_GCC_USE_MPC - select CC_GCC_HAS_GRAPHITE - select CC_GCC_HAS_LTO - select CC_GCC_HAS_PKGVERSION_BUGURL - select CC_GCC_HAS_BUILD_ID - select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER select CC_GCC_HAS_LIBMPX @@ -203,63 +183,9 @@ config CC_GCC_latest select CC_GCC_6_or_later select CC_GCC_USE_GMP_MPFR select CC_GCC_USE_MPC - select CC_GCC_HAS_GRAPHITE - select CC_GCC_HAS_LTO - select CC_GCC_HAS_PKGVERSION_BUGURL - select CC_GCC_HAS_BUILD_ID - select CC_GCC_HAS_LNK_HASH_STYLE select CC_GCC_HAS_LIBQUADMATH select CC_GCC_HAS_LIBSANITIZER -config CC_GCC_HAS_GRAPHITE - bool - -# For graphite: gcc needs cloog and isl -# In >= gcc-5.x, cloog is no longer needed, but isl is. -# Prompt in config/cc/gcc.in.2 -config CC_GCC_USE_GRAPHITE - bool - default y - depends on CC_GCC_HAS_GRAPHITE - select CLOOG_NEEDED if !CC_GCC_5_or_later - select ISL_NEEDED - help - Enable the GRAPHITE loop optimsations. - - On some systems (eg. Cygwin), CLooG and ISL (required to enable - GRAPHITE) may not build properly (yet), so you'll have to say 'N' - here (or help debug the issues) - - TODO: Is this still true on Cygwin? - -# The way LTO works is a bit twisted. -# See: http://gcc.gnu.org/wiki/LinkTimeOptimization#Requirements -# Basically: -# - if binutils has plugins: LTO is handled by ld/gold by loading -# the plugin when linking -# - if binutils does not have plugins: LTO is handled by collect2 -# In any case, LTO support does not depend on plugins, but takes -# advantage of it -config CC_GCC_HAS_LTO - bool - -# Prompt in config/cc/gcc.in.2 -config CC_GCC_USE_LTO - bool - default y - depends on CC_GCC_HAS_LTO - help - Enable the Link Time Optimisations. - -config CC_GCC_HAS_PKGVERSION_BUGURL - bool - -config CC_GCC_HAS_BUILD_ID - bool - -config CC_GCC_HAS_LNK_HASH_STYLE - bool - # Only enable gcc's support for plugins if binutils has it as well # They are useful only when doing LTO, but it does no harm enabling # them even without LTO. @@ -284,12 +210,6 @@ config CC_GCC_USE_MPC bool select MPC_NEEDED -config CC_GCC_HAS_LIBQUADMATH - bool - -config CC_GCC_HAS_LIBSANITIZER - bool - config CC_GCC_HAS_LIBMPX bool diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2 index aad488b4..6c99f201 100644 --- a/config/cc/gcc.in.2 +++ b/config/cc/gcc.in.2 @@ -96,8 +96,22 @@ config CC_GCC_SYSTEM_ZLIB comment "Optimisation features" # Defined in config/cc/gcc.in +# For graphite: gcc needs cloog and isl +# In >= gcc-5.x, cloog is no longer needed, but isl is. +# Prompt in config/cc/gcc.in.2 config CC_GCC_USE_GRAPHITE - prompt "Enable GRAPHITE loop optimisations" + bool "Enable GRAPHITE loop optimisations" + default y + select CLOOG_NEEDED if !CC_GCC_5_or_later + select ISL_NEEDED + help + Enable the GRAPHITE loop optimsations. + + On some systems (eg. Cygwin), CLooG and ISL (required to enable + GRAPHITE) may not build properly (yet), so you'll have to say 'N' + here (or help debug the issues) + + TODO: Is this still true on Cygwin? # The way LTO works is a bit twisted. # See: http://gcc.gnu.org/wiki/LinkTimeOptimization#Requirements @@ -107,11 +121,11 @@ config CC_GCC_USE_GRAPHITE # - if binutils does not have plugins: LTO is handled by collect2 # In any case, LTO support does not depend on plugins, but takes # advantage of it -# Also, only the 4.5 series needs libelf for LTO; 4.6 has dropped -# the dependency. -# Defined in config/cc/gcc.in config CC_GCC_USE_LTO - prompt "Enable LTO" + bool "Enable LTO" + default y + help + Enable the Link Time Optimisations. #----------------------------------------------------------------------------- comment "Settings for libraries running on target" @@ -258,7 +272,6 @@ config CC_GCC_LDBL_128 config CC_GCC_BUILD_ID bool prompt "Enable build-id" - depends on CC_GCC_HAS_BUILD_ID help Tells GCC to pass --build-id option to the linker for all final links (links performed without the -r or --relocatable option), @@ -271,7 +284,6 @@ config CC_GCC_BUILD_ID choice CC_GCC_LNK_HASH_STYLE_CHOICE bool prompt "linker hash style" - depends on CC_GCC_HAS_LNK_HASH_STYLE depends on BINUTILS_HAS_HASH_STYLE config CC_GCC_LNK_HASH_STYLE_DEFAULT diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh index 6d5a6af2..e14b5102 100644 --- a/scripts/build/cc/100-gcc.sh +++ b/scripts/build/cc/100-gcc.sh @@ -411,10 +411,9 @@ do_gcc_core_backend() { fi done - if [ "${CT_CC_GCC_HAS_PKGVERSION_BUGURL}" = "y" ]; then - extra_config+=("--with-pkgversion=${CT_PKGVERSION}") - [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") - fi + extra_config+=("--with-pkgversion=${CT_PKGVERSION}") + [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") + if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then extra_config+=("--enable-__cxa_atexit") else @@ -493,13 +492,13 @@ do_gcc_core_backend() { if [ "${CT_CLOOG}" = "y" ]; then extra_config+=("--with-cloog=${complibs}") fi - elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then + else extra_config+=("--with-isl=no") extra_config+=("--with-cloog=no") fi if [ "${CT_CC_GCC_USE_LTO}" = "y" ]; then extra_config+=("--enable-lto") - elif [ "${CT_CC_GCC_HAS_LTO}" = "y" ]; then + else extra_config+=("--disable-lto") fi @@ -893,10 +892,9 @@ do_gcc_backend() { done [ "${CT_SHARED_LIBS}" = "y" ] || extra_config+=("--disable-shared") - if [ "${CT_CC_GCC_HAS_PKGVERSION_BUGURL}" = "y" ]; then - extra_config+=("--with-pkgversion=${CT_PKGVERSION}") - [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") - fi + extra_config+=("--with-pkgversion=${CT_PKGVERSION}") + [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") + case "${CT_CC_GCC_SJLJ_EXCEPTIONS}" in y) extra_config+=("--enable-sjlj-exceptions");; m) ;; @@ -1004,13 +1002,13 @@ do_gcc_backend() { if [ "${CT_CLOOG}" = "y" ]; then extra_config+=("--with-cloog=${complibs}") fi - elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then + else extra_config+=("--with-isl=no") extra_config+=("--with-cloog=no") fi if [ "${CT_CC_GCC_USE_LTO}" = "y" ]; then extra_config+=("--enable-lto") - elif [ "${CT_CC_GCC_HAS_LTO}" = "y" ]; then + else extra_config+=("--disable-lto") fi