From 534332f22a66f16b4022e87ae50c11ff20c98dcb Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Mon, 12 Sep 2016 12:31:33 +1000 Subject: binutils,gcc: Add support to control LTO and Gold. --- source-builder/config/binutils-2-1.cfg | 12 ++++++++++++ source-builder/config/gcc-common-1.cfg | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source-builder/config/binutils-2-1.cfg b/source-builder/config/binutils-2-1.cfg index 397dea5..539f076 100644 --- a/source-builder/config/binutils-2-1.cfg +++ b/source-builder/config/binutils-2-1.cfg @@ -26,6 +26,16 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) # %define allow_cxc +# +# Default gold and LTO to disable. +# +%ifn %{defined with_gold} + %define with_gold 0 +%endif +%ifn %{defined with_lto} + %define with_lto 0 +%endif + # # Source # @@ -60,6 +70,8 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) --target=%{_target} \ --verbose --disable-nls \ %{?with_deterministic_archives:--enable-deterministic-archives} \ + %{?with_gold:--enable-gold=yes} \ + %{?with_lto:--enable-lto --enable-plugins}%{!?with_lto:--disable-lto} \ --without-included-gettext \ --disable-win32-registry \ --disable-werror \ diff --git a/source-builder/config/gcc-common-1.cfg b/source-builder/config/gcc-common-1.cfg index 941e15c..e5bee9d 100644 --- a/source-builder/config/gcc-common-1.cfg +++ b/source-builder/config/gcc-common-1.cfg @@ -31,6 +31,13 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) # %global _gcclibdir %{_prefix}/lib +# +# Default LTO to off. +# +%ifn %{defined with_lto} + %define with_lto 0 +%endif + # # Prepare the source code. # @@ -149,7 +156,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) --disable-nls --without-included-gettext \ --disable-win32-registry \ --enable-version-specific-runtime-libs \ - --disable-lto \ + %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \ --enable-newlib-io-c99-formats \ %{?with_iconv:--enable-newlib-iconv} \ %{?with_iconv:--enable-newlib-iconv-encodings=%{_newlib_iconv_encodings}} \ -- cgit v1.2.3