public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* configure oddity
@ 2011-02-22  2:53 Mike Stump
  2011-02-22  8:17 ` Ralf Wildenhues
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Stump @ 2011-02-22  2:53 UTC (permalink / raw)
  To: gcc patches; +Cc: Alexandre Oliva, Ralf Wildenhues

So, I was regenerating configure for another patch, and discovered differences not caused by my patch.  I installed the right version of autoconf, then ran it on the virgin configure.ac file in gcc and it produced the below patch.

Ideally, I'd like Alexandre and Ralf to rerun on their systems and see if they get what I get.  If they don't, would be nice to track down why, and get that fixed.

Ok to check in?

Index: configure
===================================================================
--- configure	(revision 170335)
+++ configure	(working copy)
@@ -886,6 +886,7 @@
 with_bugurl
 enable_languages
 with_multilib_list
+with_gnu_ld
 enable_rpath
 with_libiconv_prefix
 enable_initfini_array
@@ -899,7 +900,9 @@
 enable_static
 with_pic
 enable_fast_install
+with_gnu_ld
 enable_libtool_lock
+with_gnu_ld
 with_plugin_ld
 enable_gnu_indirect_function
 enable_comdat
@@ -924,9 +927,13 @@
 CPPFLAGS
 CXX
 CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
 CCC
 CPP
 CXXCPP
+CXXCPP
 GMPLIBS
 GMPINC
 PPLLIBS
@@ -17505,7 +17512,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17508 "configure"
+#line 17515 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17611,7 +17618,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17614 "configure"
+#line 17621 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22  2:53 configure oddity Mike Stump
@ 2011-02-22  8:17 ` Ralf Wildenhues
  2011-02-22  8:42   ` Mike Stump
  0 siblings, 1 reply; 13+ messages in thread
From: Ralf Wildenhues @ 2011-02-22  8:17 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc patches, Alexandre Oliva

Hello Mike,

* Mike Stump wrote on Tue, Feb 22, 2011 at 02:34:03AM CET:
> So, I was regenerating configure for another patch, and discovered
> differences not caused by my patch.  I installed the right version of
> autoconf, then ran it on the virgin configure.ac file in gcc and it
> produced the below patch.

Weird.  gcc/gcc/configure seems up to date over here.  Which m4 version
do you have installed?

It shouldn't matter, but can you 'rm -rf autom4te.cache' and rerun
autoconf then, does that make a difference?

This sounds like an m4 bug, or an autoconf --trace issue.

> Ideally, I'd like Alexandre and Ralf to rerun on their systems and see
> if they get what I get.  If they don't, would be nice to track down
> why, and get that fixed.

Right, let's do that.  Your patch adds spurious duplicate variables in
the list of user options and that of precious variables.  Neither should
be serious, as all that's done with these lists is checking whether some
passed argument is element of one of those sets.

> Ok to check in?

I'd prefer not.

Thanks,
Ralf

> --- configure	(revision 170335)
> +++ configure	(working copy)
> @@ -886,6 +886,7 @@
>  with_bugurl
>  enable_languages
>  with_multilib_list
> +with_gnu_ld
>  enable_rpath
>  with_libiconv_prefix
>  enable_initfini_array
> @@ -899,7 +900,9 @@
>  enable_static
>  with_pic
>  enable_fast_install
> +with_gnu_ld
>  enable_libtool_lock
> +with_gnu_ld
>  with_plugin_ld
>  enable_gnu_indirect_function
>  enable_comdat
> @@ -924,9 +927,13 @@
>  CPPFLAGS
>  CXX
>  CXXFLAGS
> +LDFLAGS
> +LIBS
> +CPPFLAGS
>  CCC
>  CPP
>  CXXCPP
> +CXXCPP
>  GMPLIBS
>  GMPINC
>  PPLLIBS
[...]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22  8:17 ` Ralf Wildenhues
@ 2011-02-22  8:42   ` Mike Stump
  2011-02-22 13:27     ` Pedro Alves
  2011-02-22 15:01     ` Jack Howarth
  0 siblings, 2 replies; 13+ messages in thread
From: Mike Stump @ 2011-02-22  8:42 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: gcc patches, Alexandre Oliva

On Feb 21, 2011, at 9:32 PM, Ralf Wildenhues wrote:
> Weird.  gcc/gcc/configure seems up to date over here.  Which m4 version
> do you have installed?

1.4.6...  I installed 1.4.15, and got the same answer.  :-(

> It shouldn't matter, but can you 'rm -rf autom4te.cache' and rerun
> autoconf then, does that make a difference?

Nope.

> This sounds like an m4 bug, or an autoconf --trace issue.

:-(  Well, that's annoying.  I've not seen autoconf fail before...  well, ok, I have, but not like this.

>> Ideally, I'd like Alexandre and Ralf to rerun on their systems and see
>> if they get what I get.  If they don't, would be nice to track down
>> why, and get that fixed.
> 
> Right, let's do that.

Ok, I'll push the bug up...

> Your patch adds spurious duplicate variables

Ok, let's nix that idea...  Thanks for the sanity check.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22  8:42   ` Mike Stump
@ 2011-02-22 13:27     ` Pedro Alves
  2011-02-22 19:41       ` Mike Stump
  2011-02-22 15:01     ` Jack Howarth
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2011-02-22 13:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Mike Stump, Ralf Wildenhues, Alexandre Oliva

On Tuesday 22 February 2011 08:23:00, Mike Stump wrote:
> > This sounds like an m4 bug, or an autoconf --trace issue.
> 
> :-(  Well, that's annoying.  I've not seen autoconf fail before...  well, ok, I have, but not like this.

Might be a pristine FSF autoconf vs distro patched autoconf issue?

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22  8:42   ` Mike Stump
  2011-02-22 13:27     ` Pedro Alves
@ 2011-02-22 15:01     ` Jack Howarth
  1 sibling, 0 replies; 13+ messages in thread
From: Jack Howarth @ 2011-02-22 15:01 UTC (permalink / raw)
  To: Mike Stump; +Cc: Ralf Wildenhues, gcc patches, Alexandre Oliva

On Tue, Feb 22, 2011 at 12:23:00AM -0800, Mike Stump wrote:
> On Feb 21, 2011, at 9:32 PM, Ralf Wildenhues wrote:
> > Weird.  gcc/gcc/configure seems up to date over here.  Which m4 version
> > do you have installed?
> 
> 1.4.6...  I installed 1.4.15, and got the same answer.  :-(
> 
> > It shouldn't matter, but can you 'rm -rf autom4te.cache' and rerun
> > autoconf then, does that make a difference?
> 
> Nope.
> 
> > This sounds like an m4 bug, or an autoconf --trace issue.
> 
> :-(  Well, that's annoying.  I've not seen autoconf fail before...  well, ok, I have, but not like this.
> 
> >> Ideally, I'd like Alexandre and Ralf to rerun on their systems and see
> >> if they get what I get.  If they don't, would be nice to track down
> >> why, and get that fixed.
> > 
> > Right, let's do that.
> 
> Ok, I'll push the bug up...
> 
> > Your patch adds spurious duplicate variables
> 
> Ok, let's nix that idea...  Thanks for the sanity check.

Mike,
   For what its worth, I've seen the same thing on x86_64-apple-darwin10 using
autoconf 2.64. In case it makes a difference, I don't use maintenance mode to
regenerate the configure files but instead explicitly use commands like...

cd libjava
autoconf -I. -I../config

                Jack

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22 13:27     ` Pedro Alves
@ 2011-02-22 19:41       ` Mike Stump
  2011-02-22 19:51         ` Peter O'Gorman
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Stump @ 2011-02-22 19:41 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gcc-patches, Ralf Wildenhues, Alexandre Oliva

On Feb 22, 2011, at 5:07 AM, Pedro Alves wrote:
> On Tuesday 22 February 2011 08:23:00, Mike Stump wrote:
>>> This sounds like an m4 bug, or an autoconf --trace issue.
>> 
>> :-(  Well, that's annoying.  I've not seen autoconf fail before...  well, ok, I have, but not like this.
> 
> Might be a pristine FSF autoconf vs distro patched autoconf issue?

Nope, mine was freshly downloaded from ftp.gnu.org.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22 19:41       ` Mike Stump
@ 2011-02-22 19:51         ` Peter O'Gorman
  2011-02-22 21:41           ` Mike Stump
  0 siblings, 1 reply; 13+ messages in thread
From: Peter O'Gorman @ 2011-02-22 19:51 UTC (permalink / raw)
  To: Mike Stump; +Cc: Pedro Alves, gcc-patches, Ralf Wildenhues, Alexandre Oliva

On 02/22/2011 12:45 PM, Mike Stump wrote:
> On Feb 22, 2011, at 5:07 AM, Pedro Alves wrote:
>> On Tuesday 22 February 2011 08:23:00, Mike Stump wrote:
>>>> This sounds like an m4 bug, or an autoconf --trace issue.
>>>
>>> :-(  Well, that's annoying.  I've not seen autoconf fail before...  well, ok, I have, but not like this.
>>
>> Might be a pristine FSF autoconf vs distro patched autoconf issue?
>
> Nope, mine was freshly downloaded from ftp.gnu.org.
>

I had a quick look at this, installing m4-1.4.15 and then autoconf-2.64 
(using your new m4) will give you these differences - not only on Mac OS X.

Rebuilding autoconf-2.64 with m4-1.4.13 works. I did not try m4-1.4.14.

Peter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22 19:51         ` Peter O'Gorman
@ 2011-02-22 21:41           ` Mike Stump
  2011-02-26 15:11             ` Ralf Wildenhues
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Stump @ 2011-02-22 21:41 UTC (permalink / raw)
  To: Peter O'Gorman
  Cc: Pedro Alves, gcc-patches, Ralf Wildenhues, Alexandre Oliva

On Feb 22, 2011, at 11:30 AM, Peter O'Gorman wrote:
> I had a quick look at this, installing m4-1.4.15 and then autoconf-2.64 (using your new m4) will give you these differences - not only on Mac OS X.
> 
> Rebuilding autoconf-2.64 with m4-1.4.13 works. I did not try m4-1.4.14.

Ah, that explains it then, autoconf smelled out gm4 (unknown to me) and used it, and it was m4-1.4.15.  It chose this over m4, which was 1.4.6.  The newer m4 came from macports.

So, do we document that one needs m4-1.4.13 or older?  Ick.  Add a PREREQ line to exclude the known buggy version?  I fixed mine by rebuilding autoconf with the old m4 in the path and this fixed it.

export M4=gm4-1.4.6 before running autoconf also fixes it as well.

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-22 21:41           ` Mike Stump
@ 2011-02-26 15:11             ` Ralf Wildenhues
  2011-02-26 15:46               ` Eric Blake
  2011-02-27 23:52               ` Mike Stump
  0 siblings, 2 replies; 13+ messages in thread
From: Ralf Wildenhues @ 2011-02-26 15:11 UTC (permalink / raw)
  To: Mike Stump
  Cc: Peter O'Gorman, Pedro Alves, gcc-patches, Alexandre Oliva, eblake

* Mike Stump wrote on Tue, Feb 22, 2011 at 10:03:07PM CET:
> On Feb 22, 2011, at 11:30 AM, Peter O'Gorman wrote:
> > I had a quick look at this, installing m4-1.4.15 and then autoconf-2.64 (using your new m4) will give you these differences - not only on Mac OS X.
> > 
> > Rebuilding autoconf-2.64 with m4-1.4.13 works. I did not try m4-1.4.14.
> 
> Ah, that explains it then, autoconf smelled out gm4 (unknown to me)
> and used it, and it was m4-1.4.15.  It chose this over m4, which was
> 1.4.6.  The newer m4 came from macports.
> 
> So, do we document that one needs m4-1.4.13 or older?  Ick.  Add a
> PREREQ line to exclude the known buggy version?  I fixed mine by
> rebuilding autoconf with the old m4 in the path and this fixed it.
> 
> export M4=gm4-1.4.6 before running autoconf also fixes it as well.

How about this patch to diagnose such issues early (test case taken from
gnulib)?  This way you get an error if you run autoconf, aclocal, or
automake, anywhere in GCC, and the underlying M4 has the problem.

I wouldn't mind a warning instead of a hard error either, if that's what
people prefer.

Thanks,
Ralf

Guard against M4 versions with a buggy strstr.

config/ChangeLog:
2011-02-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* override.m4: Error out if a buggy M4 was detected, to
	avoid spurious diffs in generated files.

diff --git a/config/override.m4 b/config/override.m4
index fc2d527..9536009 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -48,6 +48,15 @@ _GCC_AUTOCONF_VERSION_CHECK
 ])
 
 
+dnl Ensure we do not use a buggy M4.
+m4_pushdef([M], [..wi.d.])
+m4_append_uniq([M], [.d.], [])
+m4_if(M, [..wi.d.], [],
+  [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
+GNU M4 < 1.4.14 or > 1.4.15 and set the M4 environment variable]))])
+m4_popdef([M])
+
+
 dnl Fix 2.64 cross compile detection for AVR and RTEMS
 dnl by not trying to compile fopen.
 m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64],

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-26 15:11             ` Ralf Wildenhues
@ 2011-02-26 15:46               ` Eric Blake
  2011-02-27 23:52               ` Mike Stump
  1 sibling, 0 replies; 13+ messages in thread
From: Eric Blake @ 2011-02-26 15:46 UTC (permalink / raw)
  To: Ralf Wildenhues, Mike Stump, Peter O'Gorman, Pedro Alves,
	gcc-patches, Alexandre Oliva, bug-autoconf

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

On 02/26/2011 05:07 AM, Ralf Wildenhues wrote:
> How about this patch to diagnose such issues early (test case taken from
> gnulib)?  This way you get an error if you run autoconf, aclocal, or
> automake, anywhere in GCC, and the underlying M4 has the problem.

I like the concept, although I can make it shorter.

Autoconf's m4/m4.m4 needs a similar test.

> 2011-02-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
> 
> 	* override.m4: Error out if a buggy M4 was detected, to
> 	avoid spurious diffs in generated files.
> 
> diff --git a/config/override.m4 b/config/override.m4
> index fc2d527..9536009 100644
> --- a/config/override.m4
> +++ b/config/override.m4
> @@ -48,6 +48,15 @@ _GCC_AUTOCONF_VERSION_CHECK
>  ])
>  
>  
> +dnl Ensure we do not use a buggy M4.

m4_if(m4_index([..wi.d.], [.d.]), [-1],
  [m4_fatal(...

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-26 15:11             ` Ralf Wildenhues
  2011-02-26 15:46               ` Eric Blake
@ 2011-02-27 23:52               ` Mike Stump
  2011-02-28  9:44                 ` Ralf Wildenhues
  1 sibling, 1 reply; 13+ messages in thread
From: Mike Stump @ 2011-02-27 23:52 UTC (permalink / raw)
  To: Ralf Wildenhues
  Cc: Peter O'Gorman, Pedro Alves, gcc-patches, Alexandre Oliva, eblake

On Feb 26, 2011, at 4:07 AM, Ralf Wildenhues wrote:
> How about this patch to diagnose such issues early (test case taken from
> gnulib)?

For mere users and developers, they don't ever need to run autoconf, and so, no requirement?  I only had to as I was editing a configure.ac file, and wanted to regenerate.  Maybe we don't want to bother most uses and developers...  though, that said, I don't have the maintainer mode enable to re-generate, but instead was just running my hand, so if we conditionalize the check on the type of user, we might miss some.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-27 23:52               ` Mike Stump
@ 2011-02-28  9:44                 ` Ralf Wildenhues
  2011-03-05  7:34                   ` Ralf Wildenhues
  0 siblings, 1 reply; 13+ messages in thread
From: Ralf Wildenhues @ 2011-02-28  9:44 UTC (permalink / raw)
  To: Mike Stump
  Cc: Peter O'Gorman, Pedro Alves, gcc-patches, Alexandre Oliva, eblake

* Mike Stump wrote on Sun, Feb 27, 2011 at 11:40:42PM CET:
> On Feb 26, 2011, at 4:07 AM, Ralf Wildenhues wrote:
> > How about this patch to diagnose such issues early (test case taken from
> > gnulib)?
> 
> For mere users and developers, they don't ever need to run autoconf,
> and so, no requirement?

Correct.  The patch doesn't change anything for users that do not run
autoconf.

> I only had to as I was editing a configure.ac
> file, and wanted to regenerate.  Maybe we don't want to bother most
> uses and developers...  though, that said, I don't have the maintainer
> mode enable to re-generate, but instead was just running my hand, so
> if we conditionalize the check on the type of user, we might miss
> some.

This patch doesn't change at all the semantics of whether you need to
run autoconf or not.  Only when you run it, no matter whether triggered
by make or run manually, it diagnoses buggy m4 versions.

More compact patch based on Eric's feedback below.

Thanks,
Ralf

Guard against M4 versions with a buggy strstr.

config/ChangeLog:
2011-02-26  Ralf Wildenhues  <...>
	    Eric Blake  <...>

	* override.m4: Error out if a buggy M4 was detected, to
	avoid spurious diffs in generated files.

diff --git a/config/override.m4 b/config/override.m4
index fc2d527..4f3b9ae 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -48,6 +48,12 @@ _GCC_AUTOCONF_VERSION_CHECK
 ])
 
 
+dnl Ensure we do not use a buggy M4.
+m4_if(m4_index([..wi.d.], [.d.]), [-1],
+  [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
+GNU M4 < 1.4.14 or > 1.4.15 and set the M4 environment variable]))])
+
+
 dnl Fix 2.64 cross compile detection for AVR and RTEMS
 dnl by not trying to compile fopen.
 m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64],

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: configure oddity
  2011-02-28  9:44                 ` Ralf Wildenhues
@ 2011-03-05  7:34                   ` Ralf Wildenhues
  0 siblings, 0 replies; 13+ messages in thread
From: Ralf Wildenhues @ 2011-03-05  7:34 UTC (permalink / raw)
  To: gcc-patches, binutils, gdb-patches
  Cc: Mike Stump, Peter O'Gorman, Pedro Alves, Alexandre Oliva, eblake

[ http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01716.html ]

* Ralf Wildenhues wrote on Mon, Feb 28, 2011 at 07:38:50AM CET:
> This patch doesn't change at all the semantics of whether you need to
> run autoconf or not.  Only when you run it, no matter whether triggered
> by make or run manually, it diagnoses buggy m4 versions.

Nobody complained about the patch, so I'm committing it to GCC and
syncing to src, with recommendations updated.  If you get a runtime
failure from m4 when running any of autoconf, aclocal, or automake, in
the GCC or src trees, then that means you have a buggy m4 and should
update to a fixed version.

I am specifically _not_ testing for the other bug Eric found (see
http://lists.gnu.org/archive/html/autoconf-patches/2011-02/msg00035.html)
because we don't yet have evidence that the bug causes differing output
in practice, and I'm guessing that m4 versions with that particular bug
are so widespread that it would upset people to see their
--enable-maintainer-mode builds fail due to the check.

Thanks,
Ralf

2011-03-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
	    Eric Blake  <eblake@redhat.com>

	* override.m4: Error out if a buggy M4 was detected, to
	avoid spurious diffs in generated files.

diff --git a/config/override.m4 b/config/override.m4
index fc2d527..52bd1c3 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -48,6 +48,12 @@ _GCC_AUTOCONF_VERSION_CHECK
 ])
 
 
+dnl Ensure we do not use a buggy M4.
+m4_if(m4_index([..wi.d.], [.d.]), [-1],
+  [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
+GNU M4 1.4.16 or newer and set the M4 environment variable]))])
+
+
 dnl Fix 2.64 cross compile detection for AVR and RTEMS
 dnl by not trying to compile fopen.
 m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64],

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-03-05  7:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22  2:53 configure oddity Mike Stump
2011-02-22  8:17 ` Ralf Wildenhues
2011-02-22  8:42   ` Mike Stump
2011-02-22 13:27     ` Pedro Alves
2011-02-22 19:41       ` Mike Stump
2011-02-22 19:51         ` Peter O'Gorman
2011-02-22 21:41           ` Mike Stump
2011-02-26 15:11             ` Ralf Wildenhues
2011-02-26 15:46               ` Eric Blake
2011-02-27 23:52               ` Mike Stump
2011-02-28  9:44                 ` Ralf Wildenhues
2011-03-05  7:34                   ` Ralf Wildenhues
2011-02-22 15:01     ` Jack Howarth

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).