summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-09-12 12:31:33 +1000
committerChris Johns <chrisj@rtems.org>2016-09-12 12:32:26 +1000
commit534332f22a66f16b4022e87ae50c11ff20c98dcb (patch)
treefb6282a69c6d1be83cc01e6a32eacbb2322c27ac
parent7cdf3191488b1d5b7863d78cae10a28d51a9dfcf (diff)
downloadrtems-source-builder-534332f22a66f16b4022e87ae50c11ff20c98dcb.tar.bz2
binutils,gcc: Add support to control LTO and Gold.
-rw-r--r--source-builder/config/binutils-2-1.cfg12
-rw-r--r--source-builder/config/gcc-common-1.cfg9
2 files changed, 20 insertions, 1 deletions
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
@@ -27,6 +27,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
#
%source set binutils ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2
@@ -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
@@ -32,6 +32,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.
#
%prep
@@ -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}} \