diff mbox

PATCH: PR bootstrap/45954: LTO isn't enabled in stage1 cc1 with --with-build-config=bootstrap-lto

Message ID 20101017220719.GA16824@intel.com
State New
Headers show

Commit Message

H.J. Lu Oct. 17, 2010, 10:07 p.m. UTC
Hi,

This patch enables lto for stage1 if LTO is enabled. OK for trunk?

Thanks.


H.J.
---
2010-10-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR bootstrap/45954
	* configure.ac: Enable lto for stage1 if LTO is enabled.
	* configure: Regenerated.
diff mbox

Patch

diff --git a/configure b/configure
index b1fbfaa..1397c11 100755
--- a/configure
+++ b/configure
@@ -6711,7 +6711,11 @@  fi
 
 
 # By default, C is the only stage 1 language.
-stage1_languages=,c,
+if test "$enable_lto" = "yes" ; then
+  stage1_languages=,c,lto,
+else
+  stage1_languages=,c,
+fi
 
 # Target libraries that we bootstrap.
 bootstrap_target_libs=,target-libgcc,
@@ -6905,7 +6909,12 @@  if test "${enable_stage1_languages+set}" = set; then :
   enableval=$enable_stage1_languages; case ,${enable_stage1_languages}, in
     ,no,|,,)
       # Set it to something that will have no effect in the loop below
-      enable_stage1_languages=c ;;
+      if test "$enable_lto" = "yes" ; then
+        enable_stage1_languages=c,lto
+      else
+        enable_stage1_languages=c
+      fi
+      ;;
     ,yes,)
       enable_stage1_languages=`echo $new_enable_languages | \
 	sed -e "s/^,//" -e "s/,$//" ` ;;
diff --git a/configure.ac b/configure.ac
index bf5fe3a..f4521bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1817,7 +1817,11 @@  fi],[if test x"$default_enable_lto" = x"yes" ; then
 
 
 # By default, C is the only stage 1 language.
-stage1_languages=,c,
+if test "$enable_lto" = "yes" ; then
+  stage1_languages=,c,lto,
+else
+  stage1_languages=,c,
+fi
 
 # Target libraries that we bootstrap.
 bootstrap_target_libs=,target-libgcc,
@@ -2012,7 +2016,12 @@  if test -d ${srcdir}/gcc; then
   [case ,${enable_stage1_languages}, in
     ,no,|,,)
       # Set it to something that will have no effect in the loop below
-      enable_stage1_languages=c ;;
+      if test "$enable_lto" = "yes" ; then
+        enable_stage1_languages=c,lto
+      else
+        enable_stage1_languages=c
+      fi
+      ;;
     ,yes,)
       enable_stage1_languages=`echo $new_enable_languages | \
 	sed -e "s/^,//" -e "s/,$//" ` ;;