Re: reconfigured configure arg

Message ID 20180912183737.GJ8250@tucnak
State New
Headers show
Series
  • Re: reconfigured configure arg
Related show

Commit Message

Jakub Jelinek Sept. 12, 2018, 6:37 p.m.
On Mon, Sep 03, 2018 at 02:14:55PM +0000, Joseph Myers wrote:
> On Sat, 1 Sep 2018, Jakub Jelinek wrote:

> 

> > Couldn't we do something smarter than this?

> > Noticed while debugging why our bisect seed machine spends over 2 minutes in

> > sed when handling config.status, and the reason apparently was that it has

> > " : (reconfigured) " string in it 37753 times, so almost 700KB just in

> > that.  If it is useful information how many times gcc has been reconfigured,

> > can't we use a human readable form instead, where we add

> > " : (reconfigured) " the first time and then just change it to

> > " : (2x reconfigured) ", ..., " : (37753x reconfigured) " etc.?

> > 

> > Also, don't we actually add the above way $TOPLEVEL_CONFIGURE_ARGUMENTS

> > multiple times (if not empty, that is)?

> 

> I think my original idea when adding this information in 

> <https://gcc.gnu.org/ml/gcc-patches/2000-11/msg00289.html> was that, if 

> reconfigured, the arguments in TOPLEVEL_CONFIGURE_ARGUMENTS might include 

> synthetic ones created by config.status.  So simply using 

> TOPLEVEL_CONFIGURE_ARGUMENTS (and ignoring the previous set of configure 

> arguments) in the case of reconfiguration would give misleading results, 

> but also not mentioning it at all would give misleading results if someone 

> did in fact specify different configure options manually when 

> reconfiguring.  I was not expecting 37753x reconfiguration.


That was in our bisect seed...

Would the following minimal patch be acceptable, which just doesn't append
the " : (reconfigured) " + arguments if the configure arguments already end
with exactly that?

Bootstrapped/regtested on x86_64-linux and i686-linux, plus tested with
./config.status --recheck done the first time after configure (reconfigured
added) and second and following time (not added).  Ok for trunk?

2018-09-12  Jakub Jelinek  <jakub@redhat.com>

	* configure.ac: Only append
	" : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS" to
	gcc_config_arguments if it was never reconfigured or last reconfigure
	was with different arguments.
	* configure: Regenerated.



	Jakub

Comments

Joseph Myers Sept. 12, 2018, 7:37 p.m. | #1
On Wed, 12 Sep 2018, Jakub Jelinek wrote:

> Would the following minimal patch be acceptable, which just doesn't append

> the " : (reconfigured) " + arguments if the configure arguments already end

> with exactly that?

> 

> Bootstrapped/regtested on x86_64-linux and i686-linux, plus tested with

> ./config.status --recheck done the first time after configure (reconfigured

> added) and second and following time (not added).  Ok for trunk?


OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

Patch

--- gcc/configure.ac.jj	2018-08-26 22:42:22.518779717 +0200
+++ gcc/configure.ac	2018-09-12 19:10:14.714835001 +0200
@@ -1744,7 +1744,10 @@  changequote(,)dnl
 if test -f configargs.h ; then
 	# Being re-configured.
 	gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
-	gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
+	gcc_reconf_arguments=`echo "$gcc_config_arguments" | sed -e 's/^.*\( : (reconfigured) .*$\)/\1/'`
+	if [ "$gcc_reconf_arguments" != " : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS" ]; then
+		gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
+	fi
 else
 	gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
 fi
--- gcc/configure.jj	2018-08-26 22:42:05.912058938 +0200
+++ gcc/configure	2018-09-12 19:10:39.358433613 +0200
@@ -11836,7 +11836,10 @@  xm_file="auto-host.h ansidecl.h ${xm_fil
 if test -f configargs.h ; then
 	# Being re-configured.
 	gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
-	gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
+	gcc_reconf_arguments=`echo "$gcc_config_arguments" | sed -e 's/^.*\( : (reconfigured) .*$\)/\1/'`
+	if [ "$gcc_reconf_arguments" != " : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS" ]; then
+		gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
+	fi
 else
 	gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
 fi
@@ -18460,7 +18463,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18463 "configure"
+#line 18466 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18566,7 +18569,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18569 "configure"
+#line 18572 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19731,20 +19734,20 @@  if test -z "$aix_libpath"; then aix_libp
 	      prelink_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      old_archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'