From patchwork Sat Nov 2 22:46:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1188483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512267-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="hgMguhPM"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 475DhN10Vpz9sPF for ; Sun, 3 Nov 2019 09:46:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=Eo6VjiJlll3EHgZl 3xVZNEmZqBgZU52L3UjRDEb/2LECmulkNPFCcLeQ7H35sbNq4O9Wi33J0/pi24xf j+auQkfRLkyqP3Gz8r2DqQHr1MyypURLRDsKeEz+CMsGR4fmtDOSsdR+9KjbuTtX nhUE6DaHUkSg6r31InNWt7RsnGA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=bnGKYFwWzoyJZJDpUQq/zn xhNXw=; b=hgMguhPM6aAzcS4tHQSujVcmhtzGSzOCZ827Mpi5/Q8qeeCpBX6TU8 TAsyCAnpY73NkSaG6tK40SAy+rBfDhRU7y7eqzIGseEtY39eXxgtoVBMcCTniVmk G4vTf6TMz5Ii2dU87muv8lshv+nJt+7LwaKDVCwTDaDyfW+tHg1p0= Received: (qmail 11973 invoked by alias); 2 Nov 2019 22:46:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11964 invoked by uid 89); 2 Nov 2019 22:46:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=recursion, enable-obsolete, autoconf, libdir X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 02 Nov 2019 22:46:39 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0044C560C1; Sat, 2 Nov 2019 18:46:38 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jKGHFmvb-T6L; Sat, 2 Nov 2019 18:46:37 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id B20A7560C0; Sat, 2 Nov 2019 18:46:37 -0400 (EDT) Received: from livre.home (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id xA2MkMuV207112 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Nov 2019 19:46:24 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [FYI] pass --enable-obsolete to build configure Date: Sat, 02 Nov 2019 19:46:22 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Configuring GCC for obsolete targets works as long as build = host. When it isn't, --enable-obsolete is not passed down to the additional build configure started by gcc/configure, used to generate auto-build.h. The build configure fails and we end up without a auto-build.h, but the host configure proceeds, so we only get a fatal failure much later, when make realizes auto-build.h is not there and there's no rule to create it. This patch gets the host configure to fail when the build configure does, leaving the temporary build configure dir behind for investigation. It also arranges for --enable-obsolete to be passed down to the build configure. Alas, the latter triggered a warning in the build configure because --enable-obsolete is not a recognized configure option. That's not reported in the host configure because of the --disable-option-checking passed by the top-level configure, so I arranged for that to be passed down to the build configure as well. Finally, since my initial suspicion when investigating this failure was that auto-build.h had been removed after configuration and there was no rule to rebuild it, I'm adding rules to gcc/Makefile to get it created or updated as needed. Since it is configure that creates it, as run by e.g. config.status --recheck, and config.status is created after auto-build.h, I've made config.status depend on auto-build.h, and added a dummy rule to create auto-build.h. This would normally not be enough to create a header when needed, but since Makefile depends on config.status, and make first updates Makefile, it ends up working, as long as nothing else that Makefile depends on requires auto-build.h but not config.status. The config.status dependency and the auto-build.h rule are only enabled in the cases in which auto-build.h is actually used, namely when build != host. Tested on x86_64-linux-gnu, with build != host and an obsolete target, to check the --enable-obsolete passing down, and a native configuration to check that the new Makefile rules are not enabled. I'll check this in if there aren't objections in the next few days. for gcc/ChangeLog * configure.ac: Pass --enable-obsolete=* and --enable-option-checking=* down to build configure, and fail if it fails. AC_SUBST HAVE_AUTO_BUILD. * configure: Rebuild. * Makefile.in [HAVE_AUTO_BUILD] (auto-build.h): New rule. [HAVE_AUTO_BUILD] (config.status): Depend on auto-build.h. --- gcc/Makefile.in | 8 ++++++++ gcc/configure | 37 ++++++++++++++++++++++++++++--------- gcc/configure.ac | 8 +++++++- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 035b58f..95f054c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1899,6 +1899,14 @@ cstamp-h: config.in config.status CONFIG_FILES= \ LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status +# On configurations that require auto-build.h, it is created while +# running configure, so make config.status depend on it, so that +# config.status --recheck runs and updates or creates it. +@HAVE_AUTO_BUILD@auto-build.h: $(srcdir)/configure $(srcdir)/config.gcc +@HAVE_AUTO_BUILD@ @if test -f $@; then echo rerunning config.status to update $@; \ +@HAVE_AUTO_BUILD@ else echo rerunning config.status to update $@; fi +@HAVE_AUTO_BUILD@config.status: auto-build.h + # Really, really stupid make features, such as SUN's KEEP_STATE, may force # a target to build even if it is up-to-date. So we must verify that # config.status does not exist before failing. diff --git a/gcc/configure b/gcc/configure index 5794582..1ebe373 100755 --- a/gcc/configure +++ b/gcc/configure @@ -774,6 +774,7 @@ LIBINTL_DEP LIBINTL USE_NLS get_gcc_base_ver +HAVE_AUTO_BUILD extra_opt_files extra_modes_file NATIVE_SYSTEM_HEADER_DIR @@ -903,6 +904,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -1067,6 +1069,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1319,6 +1322,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1456,7 +1468,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1609,6 +1621,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -5893,7 +5906,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5939,7 +5952,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -5963,7 +5976,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -6008,7 +6021,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -6032,7 +6045,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12150,6 +12163,7 @@ done if test x$host = x$build then build_auto=auto-host.h + HAVE_AUTO_BUILD='# ' else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new @@ -12172,7 +12186,10 @@ else GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ ${realsrcdir}/configure \ --enable-languages=${enable_languages-all} \ - --target=$target_alias --host=$build_alias --build=$build_alias + ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \ + ${enable_option_checking+--enable-option-checking="$enable_option_checking"} \ + --target=$target_alias --host=$build_alias \ + --build=$build_alias || exit # retaining $tempdir # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. @@ -12180,9 +12197,11 @@ else cd .. rm -rf $tempdir build_auto=auto-build.h + HAVE_AUTO_BUILD= fi + tm_file="${tm_file} defaults.h" tm_p_file="${tm_p_file} tm-preds.h" tm_d_file="${tm_d_file} defaults.h" @@ -18868,7 +18887,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18871 "configure" +#line 18890 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18974,7 +18993,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18977 "configure" +#line 18996 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 8df849f4..71ae18e0 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1830,6 +1830,7 @@ AC_SUBST(extra_opt_files) if test x$host = x$build then build_auto=auto-host.h + HAVE_AUTO_BUILD='# ' else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new @@ -1852,7 +1853,10 @@ else GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ ${realsrcdir}/configure \ --enable-languages=${enable_languages-all} \ - --target=$target_alias --host=$build_alias --build=$build_alias + ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \ + ${enable_option_checking+--enable-option-checking="$enable_option_checking"} \ + --target=$target_alias --host=$build_alias \ + --build=$build_alias || exit # retaining $tempdir # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. @@ -1860,8 +1864,10 @@ else cd .. rm -rf $tempdir build_auto=auto-build.h + HAVE_AUTO_BUILD= fi AC_SUBST(build_subdir) +AC_SUBST(HAVE_AUTO_BUILD) tm_file="${tm_file} defaults.h" tm_p_file="${tm_p_file} tm-preds.h"