From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3120 invoked by alias); 17 Aug 2009 19:34:02 -0000 Received: (qmail 3082 invoked by uid 22791); 17 Aug 2009 19:34:00 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_92,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 17 Aug 2009 19:33:54 +0000 Received: (qmail invoked by alias); 17 Aug 2009 19:33:50 -0000 Received: from xdsl-87-78-64-42.netcologne.de (EHLO localhost.localdomain) [87.78.64.42] by mail.gmx.net (mp021) with SMTP; 17 Aug 2009 21:33:50 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1Md7xl-00019N-Uc; Mon, 17 Aug 2009 21:33:49 +0200 Date: Mon, 17 Aug 2009 20:47:00 -0000 From: Ralf Wildenhues To: Paolo Bonzini 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) Message-ID: <20090817193348.GA4170@gmx.de> Mail-Followup-To: Ralf Wildenhues , Paolo Bonzini , gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb@sourceware.org References: <20090815112928.GB5396@gmx.de> <20090815113356.GD20172@gmx.de> <84fc9c000908150448p73a22bbbm59c7abbccfc7f225@mail.gmail.com> <20090815122258.GF20172@gmx.de> <20090815122907.GA20449@gmx.de> <4A86E085.1000409@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A86E085.1000409@gnu.org> User-Agent: Mutt/1.5.20 (2009-08-09) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00291.txt.bz2 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 | + | 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: 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 * configure.ac: Call AC_DISABLE_OPTION_CHECKING. * configure: Regenerate. config/ChangeLog: 2009-08-17 Ralf Wildenhues * 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.