From af2a25c891b5fbe39a68ce1d2d0e501a2c8ca6ae Mon Sep 17 00:00:00 2001
From: Aurelien Larcher <aurelien.larcher@gmail.com>
Date: Thu, 19 Aug 2021 10:17:28 +0200
Subject: [PATCH] gcc-component: disable bootstrap if same compiler as host

---
 make-rules/gcc-component.mk |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/make-rules/gcc-component.mk b/make-rules/gcc-component.mk
index 4dcb217..73226d4 100644
--- a/make-rules/gcc-component.mk
+++ b/make-rules/gcc-component.mk
@@ -127,6 +127,14 @@
 CONFIGURE_OPTIONS+= --with-ld=/usr/bin/ld
 CONFIGURE_OPTIONS+= --with-build-time-tools=/usr/gnu/$(GNU_TRIPLET)/bin
 
+# If the compiler used to build matches the compiler being built, there is no
+# need for a 3 stage build.
+ifneq ($(shell $(CC) --version | grep $(COMPONENT_VERSION)),)
+CONFIGURE_OPTIONS +=    --disable-bootstrap
+else
+COMPONENT_BUILD_TARGETS=bootstrap
+endif
+
 # On SPARC systems, use Sun Assembler
 CONFIGURE_OPTIONS.sparc+= --without-gnu-as --with-as=/usr/bin/as
 CONFIGURE_OPTIONS.i386+= --with-gnu-as --with-as=/usr/bin/gas

--
Gitblit v1.9.3