public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb@sourceware.org
Subject: fix 2.64 fopen glitch, disable option checking (was: [PATCH 4/N] The  big bump)
Date: Mon, 17 Aug 2009 20:47:00 -0000	[thread overview]
Message-ID: <20090817193348.GA4170@gmx.de> (raw)
In-Reply-To: <4A86E085.1000409@gnu.org>

Suggested patch to avoid the 2.64 glitch, and to disable option checking
in the top level.  This patch could be applied right now, as with 2.59,
all it does is add white space to the toplevel configure script.

With 2.64 and up, the AC_DISABLE_OPTION_CHECKING avoids warnings about
 --enable-*, --disable-*, --with-* and --without-*
switches passed in by the user and unknown to the toplevel configure
script.  Note that with this patch, subdirectory configure scripts may
still warn about unknown switches.  We could easily avoid that across
the whole tree by letting just the toplevel pass
--disable-option-checking to each sub configure script invoked, e.g.,
by adding it to $baseargs in configure.ac.  Do you want that?  If yes,
OK to just squash it in with this patch?  (2.59 scripts will ignore
the argument.)

With exactly 2.64, this patch changes the AC_PROG_{CC,CXX,FC,F77}
expansions used throughout the tree to avoid trying out fopen in the
test for whether the compiler works and we don't cross compile.  The
diff for the toplevel configure script looks like this:

| --- b/configure
| +++ a/configure
| @@ -3897,12 +3897,10 @@ done
|  
|  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|  /* end confdefs.h.  */
| -#include <stdio.h>
| +
|  int
|  main ()
|  {
| -FILE *f = fopen ("conftest.out", "w");
| - return ferror (f) || fclose (f) != 0;
|  
|    ;
|    return 0;

This change ought to fix build for AVR and RTEMS and maybe other
embedded architectures that do not provide a hosted C implementation
by default; OTOH, it re-opens a small bug for hybrid systems like
BlueGene in that configure falsely assumes non-cross-compiling there
unless you pass both --build and --host correctly.

See these threads for the corresponding bug reports and discussions:
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6839>
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/6656>

Wrt. also overriding the things for the other languages, I'm not sure
that's ever necessary, but it can't hurt to play safe here.

OK to commit to GCC and src right away?

Thanks,
Ralf

Disable option checking in the toplevel, avoid 2.64 fopen glitch.

ChangeLog:
2009-08-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac: Call AC_DISABLE_OPTION_CHECKING.
	* configure: Regenerate.

config/ChangeLog:
2009-08-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* override.m4 (AC_DISABLE_OPTION_CHECKING): Define to be
	empty if not defined, to avoid error with 2.59.
	(_AC_LANG_IO_PROGRAM): When the Autoconf version is exactly
	2.64, avoid per-language instances to drop fopen from test
	program.

diff --git a/config/override.m4 b/config/override.m4
index bf112db..a10146f 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -58,6 +58,19 @@ m4_define([AC_INIT], m4_defn([AC_INIT])[
 _GCC_AUTOCONF_VERSION_CHECK
 ])
 
+
+dnl Turn AC_DISABLE_OPTION_CHECKING into a no-op if not defined.
+m4_ifndef([AC_DISABLE_OPTION_CHECKING],
+  [m4_define([AC_DISABLE_OPTION_CHECKING])])
+
+
+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],
+  [m4_foreach([_GCC_LANG], [C, C++, Fortran, Fortran 77],
+     [m4_define([_AC_LANG_IO_PROGRAM(]_GCC_LANG[)], m4_defn([AC_LANG_PROGRAM(]_GCC_LANG[)]))])])
+
+
 m4_version_prereq([2.60],, [
 dnl We use $ac_pwd in some of the overrides below; ensure its definition
 m4_divert_push([PARSE_ARGS])dnl
diff --git a/configure.ac b/configure.ac
index dcd9ced..2e07713 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,7 @@ m4_include(config/proginstall.m4)
 
 AC_INIT(move-if-change)
 AC_PREREQ(2.59)
+AC_DISABLE_OPTION_CHECKING
 
 progname=$0
 # if PWD already has a value, it is probably wrong.

  reply	other threads:[~2009-08-17 19:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 11:29 Moving to Autoconf 2.64, Automake 1.11 Ralf Wildenhues
2009-08-15 11:31 ` [PATCH 1/N] Update automake-provided files in the toplevel Ralf Wildenhues
2009-08-15 11:33 ` [PATCH 3/N] some minor fixes in sim, gold, gdb Ralf Wildenhues
2009-08-17 16:17   ` Tom Tromey
2009-08-17 16:19   ` Ian Lance Taylor
2009-08-15 11:34 ` Moving to Autoconf 2.64, Automake 1.11 Gerald Pfeifer
2009-08-16  9:49   ` Do not point to sources.redhat.com for autotools tarballs (was: Moving to Autoconf 2.64, Automake 1.11) Ralf Wildenhues
2009-08-16 17:23     ` Eli Zaretskii
2009-08-15 11:34 ` [PATCH 4/N] The big bump Ralf Wildenhues
2009-08-15 11:49   ` Richard Guenther
2009-08-15 12:23     ` Ralf Wildenhues
2009-08-15 12:29       ` Ralf Wildenhues
2009-08-15 16:21         ` Paolo Bonzini
2009-08-17 20:47           ` Ralf Wildenhues [this message]
2009-08-17 22:52             ` fix 2.64 fopen glitch, disable option checking Paolo Bonzini
2009-08-15 14:41   ` [PATCH 4/N] The big bump Dave Korn
2009-08-15 16:04     ` Ralf Wildenhues
2009-08-15 16:36       ` Dave Korn
     [not found]         ` <20090818191404.GB30961__32944.9385325008$1250622877$gmane$org@gmx.de>
2009-08-18 20:32           ` Tom Tromey
2009-08-24 17:31             ` Christopher Faylor
2009-08-24 19:17               ` updating autotools in the rest of src (was: [PATCH 4/N] The big bump) Ralf Wildenhues
2009-08-15 16:26     ` [PATCH 4/N] The big bump Joseph S. Myers
2009-08-18 19:36       ` Ralf Wildenhues
2009-08-18 19:40         ` Paolo Bonzini
2009-08-19  0:00         ` Dave Korn
2009-08-17 11:49   ` Nick Clifton
2009-08-18 18:18     ` Ralf Wildenhues
2009-08-19  7:07       ` Nick Clifton
2009-08-23 13:24   ` Andreas Schwab
2009-08-23 13:31     ` yacc and lex reruns without maintainer-mode (was: [PATCH 4/N] The big bump) Ralf Wildenhues
2009-08-24  7:18       ` Alan Modra
2009-08-15 11:35 ` [PATCH 5/N] post-update cleanups Ralf Wildenhues
2009-08-15 16:58   ` Paolo Bonzini
2009-08-15 15:31 ` Moving to Autoconf 2.64, Automake 1.11 Joseph S. Myers
2009-08-15 16:07   ` Ralf Wildenhues
2009-08-16 11:48     ` install-{html,pdf} (was: Moving to Autoconf 2.64, Automake 1.11) Ralf Wildenhues
2009-08-17 12:12       ` install-{html,pdf} Paolo Bonzini
2009-08-15 18:04 ` Moving to Autoconf 2.64, Automake 1.11 Paolo Bonzini
2009-08-15 23:07   ` Ralf Wildenhues
     [not found] ` <20090815113449.GE20172__4676.41973305053$1250336143$gmane$org@gmx.de>
2009-08-17 16:19   ` [PATCH 5/N] post-update cleanups Tom Tromey
2009-08-23  9:44 ` Moving to Autoconf 2.64, Automake 1.11 Ralf Wildenhues
2009-08-27 14:23 ` Matthias Klose
2009-08-27 15:02   ` Matthias Klose

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=20090817193348.GA4170@gmx.de \
    --to=ralf.wildenhues@gmx.de \
    --cc=binutils@sourceware.org \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    /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).