From: "Martin Liška" <mliska@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>,
Richard Biener <richard.guenther@gmail.com>
Subject: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
Date: Thu, 25 May 2017 09:26:00 -0000 [thread overview]
Message-ID: <41109217-1bf5-b112-e783-8040196fd410@suse.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
Hello.
After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
introduce --with-stage1-cflags where one can provide such options.
Apart from that, maybe it would be handy to automatically enable "-O2" when
one has a recent compiler? Do we have an example where we detect host compiler
and it's version?
Martin
[-- Attachment #2: 0001-Introduce-configure-flag-with-stage1-cflags.patch --]
[-- Type: text/x-patch, Size: 4008 bytes --]
From 5c44f79237125ad2bc29fcd1fb06a249c05b277d Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 25 May 2017 11:17:29 +0200
Subject: [PATCH] Introduce configure flag --with-stage1-cflags.
ChangeLog:
2017-05-25 Martin Liska <mliska@suse.cz>
* configure.ac: Introduce configure flag --with-stage1-cflags.
* configure: Regenerate.
---
configure | 40 +++++++++++++++++++++++++++-------------
configure.ac | 31 +++++++++++++++++++------------
2 files changed, 46 insertions(+), 25 deletions(-)
diff --git a/configure b/configure
index 2c2fe644cfa..442f78d9565 100755
--- a/configure
+++ b/configure
@@ -559,7 +559,6 @@ compare_exclusions
host_shared
stage2_werror_flag
stage1_checking
-stage1_cflags
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -652,6 +651,7 @@ isllibs
poststage1_ldflags
poststage1_libs
stage1_ldflags
+stage1_cflags
stage1_libs
extra_isl_gmp_configure_flags
extra_mpc_mpfr_configure_flags
@@ -771,6 +771,7 @@ with_gmp
with_gmp_include
with_gmp_lib
with_stage1_libs
+with_stage1_cflags
with_stage1_ldflags
with_boot_libs
with_boot_ldflags
@@ -1542,6 +1543,8 @@ Optional Packages:
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library
--with-stage1-libs=LIBS libraries for stage1
+ --with-stage1-cflags=FLAGS
+ compiler flags for stage1
--with-stage1-ldflags=FLAGS
linker flags for stage1
--with-boot-libs=LIBS libraries for stage2 and later
@@ -5804,6 +5807,29 @@ fi
+# Compiler flags to use for stage1 or when not bootstrapping.
+
+# Check whether --with-stage1-cflags was given.
+if test "${with_stage1_cflags+set}" = set; then :
+ withval=$with_stage1_cflags; if test "$withval" = "no" -o "$withval" = "yes"; then
+ stage1_cflags=
+ else
+ stage1_cflags=$withval
+ fi
+else
+ stage1_cflags="-g"
+ case $build in
+ vax-*-*)
+ case ${GCC} in
+ yes) stage1_cflags="-g -Wa,-J" ;;
+ *) stage1_cflags="-g -J" ;;
+ esac ;;
+ esac
+fi
+
+
+
+
# Linker flags to use for stage1 or when not bootstrapping.
# Check whether --with-stage1-ldflags was given.
@@ -14544,18 +14570,6 @@ MAINT=$MAINTAINER_MODE_TRUE
# GCC bootstrap support
# ---------------------
-# Stage specific cflags for build.
-stage1_cflags="-g"
-case $build in
- vax-*-*)
- case ${GCC} in
- yes) stage1_cflags="-g -Wa,-J" ;;
- *) stage1_cflags="-g -J" ;;
- esac ;;
-esac
-
-
-
# Enable --enable-checking in stage1 of the compiler.
# Check whether --enable-stage1-checking was given.
if test "${enable_stage1_checking+set}" = set; then :
diff --git a/configure.ac b/configure.ac
index 865dd543fa3..7b7902240c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1637,6 +1637,25 @@ AC_ARG_WITH(stage1-libs,
[stage1_libs=])
AC_SUBST(stage1_libs)
+# Compiler flags to use for stage1 or when not bootstrapping.
+AC_ARG_WITH(stage1-cflags,
+[AS_HELP_STRING([--with-stage1-cflags=FLAGS], [compiler flags for stage1])],
+[if test "$withval" = "no" -o "$withval" = "yes"; then
+ stage1_cflags=
+ else
+ stage1_cflags=$withval
+ fi],
+[stage1_cflags="-g"
+ case $build in
+ vax-*-*)
+ case ${GCC} in
+ yes) stage1_cflags="-g -Wa,-J" ;;
+ *) stage1_cflags="-g -J" ;;
+ esac ;;
+ esac])
+
+AC_SUBST(stage1_cflags)
+
# Linker flags to use for stage1 or when not bootstrapping.
AC_ARG_WITH(stage1-ldflags,
[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
@@ -3421,18 +3440,6 @@ AC_SUBST(MAINT)dnl
# GCC bootstrap support
# ---------------------
-# Stage specific cflags for build.
-stage1_cflags="-g"
-case $build in
- vax-*-*)
- case ${GCC} in
- yes) stage1_cflags="-g -Wa,-J" ;;
- *) stage1_cflags="-g -J" ;;
- esac ;;
-esac
-
-AC_SUBST(stage1_cflags)
-
# Enable --enable-checking in stage1 of the compiler.
AC_ARG_ENABLE(stage1-checking,
[AS_HELP_STRING([[--enable-stage1-checking[=all]]],
--
2.12.2
next reply other threads:[~2017-05-25 9:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-25 9:26 Martin Liška [this message]
2017-05-26 11:47 ` Richard Biener
2017-05-26 11:55 ` Jakub Jelinek
2017-05-26 11:59 ` Richard Biener
2017-05-26 13:02 ` Martin Liška
2017-05-26 13:19 ` Martin Liška
2017-06-19 10:51 ` Martin Liška
2017-06-19 12:30 ` Richard Biener
2017-07-31 7:48 ` Martin Liška
2017-08-25 20:49 ` Jeff Law
2017-08-28 12:55 ` Richard Biener
2017-08-30 12:19 ` Martin Liška
2017-05-29 11:35 ` Eric Botcazou
2017-05-30 7:00 ` Richard Biener
2017-05-30 10:30 ` Eric Botcazou
2017-05-30 10:33 ` Martin Liška
2017-05-30 11:12 ` Eric Botcazou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41109217-1bf5-b112-e783-8040196fd410@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).