From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 1E3443858005 for ; Thu, 4 Nov 2021 20:02:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E3443858005 Received: by mail-wr1-x432.google.com with SMTP id o14so10332394wra.12 for ; Thu, 04 Nov 2021 13:02:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=3OxwjY47mH8ob5uq++9VvxDDKWQ/p2D76oznIeGTcJ4=; b=1z66yOYSA1fJHKgw+j+29UQkgxkIJHBEhVSqoBX2CBSMaAiJRyhwBDR9r0DbPC0t7X cO7OnoVdve5xhrYSQ5nZCsuZPGUTv9i1e9560WF4JnZatwVz/yd77bRqmu+gd4XMG48U SrOcVLOZi9V4MMHCNrZ5RtZnN4NX39Puex1TGcrKoBpgldRQFZbkQJ7tflaG3TfkS4mQ yflfL0zi1r9gzdgaKFiR0KAOUmz7DpPYE/6a8sEaY/MCAZbNQf9kQfjYZbhphmQ1pfko wiN+VoT5todTfuNt2qtsBVwreXCIU5lMurL8tlM/+gcjgAZp+MtOnzG431432fnpHV5N YsNg== X-Gm-Message-State: AOAM5325bwZhlOutvd+wT2N4Hn8wI0KyKMhcsQ4cX1F7XKj6azmOoXrw RvRr22dj6RB2mn2PbbtfTanFbnkaXIk= X-Google-Smtp-Source: ABdhPJz0OohX37V9TJ7BPboL2c6jwrdW4Y5+hXQfFbDmKdvmhU1f8mlP1+Avc8YUbkAbk7N6yPIlNA== X-Received: by 2002:adf:f98c:: with SMTP id f12mr30344112wrr.184.1636056145183; Thu, 04 Nov 2021 13:02:25 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id k27sm6650629wms.41.2021.11.04.13.02.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Nov 2021 13:02:24 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/4] config: Add top-level flag to disable host PCH. Date: Thu, 4 Nov 2021 20:02:15 +0000 Message-Id: <20211104200218.24159-2-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20211104200218.24159-1-iain@sandoe.co.uk> References: <20211104200218.24159-1-iain@sandoe.co.uk> Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 20:02:30 -0000 This provides a --disable-host-pch-support configure flag that is passed down to libcpp, gcc and libstdc++ where the support for PCH is enacted. Signed-off-by: Iain Sandoe ChangeLog: * Makefile.def: Pass host PCH support configuration to libcpp, gcc and libstdc++. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Add --disable-host-pch-support flag. * doc/install.texi: Document the option. --- Makefile.def | 9 +++-- Makefile.in | 87 +++++++++++++++++++++++++++++--------------- configure | 42 +++++++++++++++++++++ configure.ac | 35 ++++++++++++++++++ gcc/doc/install.texi | 6 +++ 5 files changed, 146 insertions(+), 33 deletions(-) diff --git a/Makefile.def b/Makefile.def index 0abc42b1a1b..671d1c7ccc6 100644 --- a/Makefile.def +++ b/Makefile.def @@ -47,7 +47,8 @@ host_modules= { module= fixincludes; bootstrap=true; host_modules= { module= flex; no_check_cross= true; }; host_modules= { module= gas; bootstrap=true; }; host_modules= { module= gcc; bootstrap=true; - extra_make_flags="$(EXTRA_GCC_FLAGS)"; }; + extra_make_flags="$(EXTRA_GCC_FLAGS)"; + extra_configure_flags="@configure_host_pch_support@"; }; host_modules= { module= gmp; lib_path=.libs; bootstrap=true; // Work around in-tree gmp configure bug with missing flex. extra_configure_flags='--disable-shared LEX="touch lex.yy.c"'; @@ -81,7 +82,8 @@ host_modules= { module= tcl; host_modules= { module= itcl; }; host_modules= { module= ld; bootstrap=true; }; host_modules= { module= libbacktrace; bootstrap=true; }; -host_modules= { module= libcpp; bootstrap=true; }; +host_modules= { module= libcpp; bootstrap=true; + extra_configure_flags="@configure_host_pch_support@"; }; // As with libiconv, don't install any of libcody host_modules= { module= libcody; bootstrap=true; no_install= true; @@ -152,7 +154,8 @@ host_modules= { module= libctf; bootstrap=true; }; target_modules = { module= libstdc++-v3; bootstrap=true; lib_path=src/.libs; - raw_cxx=true; }; + raw_cxx=true; + extra_configure_flags="@configure_host_pch_support@"; }; target_modules = { module= libsanitizer; bootstrap=true; lib_path=.libs; diff --git a/configure.ac b/configure.ac index 550e6993b59..0d9c36bf6d6 100644 --- a/configure.ac +++ b/configure.ac @@ -408,6 +408,41 @@ AC_ARG_ENABLE(compressed_debug_sections, fi ], [enable_compressed_debug_sections=]) +# Add a configure option to control whether the host will support pre-compiled +# headers (PCH) for the c-family compilers. At present, the default is 'yes' +# for most platforms but this can be adjusted below for any that are unable to +# support it. 'configure_host_pch_support' is passed as an additional config +# arg to the configures for host and target modules that depend on the support +# where this is not specified explicitly. +configure_host_pch_support= +AC_ARG_ENABLE(host_pch_support, +[AS_HELP_STRING([--disable-host-pch-support], + [Disable support for C-family precompiled headers])], +[ + ENABLE_HOST_PCH=$enableval + case "${host}" in + aarch64-*-darwin* | arm64*-*-darwin*) + if test "x${ENABLE_HOST_PCH}" = xyes; then + AC_MSG_ERROR([PCH is not supported on aarch64/arm64 Darwin hosts]) + fi + ;; + *) + ;; + esac +],[ + # The configure line does not specify, so set appropriate values to pass to + # module configures that depend on this. + case "${host}" in + aarch64-*-darwin* | arm64*-*-darwin*) + configure_host_pch_support='--enable-host-pch-support=no' + ;; + *) + configure_host_pch_support='--enable-host-pch-support=yes' + ;; + esac +]) +AC_SUBST(configure_host_pch_support) + # Configure extra directories which are host specific case "${host}" in diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 094469b9a4e..5581e4cb063 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1015,6 +1015,12 @@ This option is required when building the libgccjit.so library. Contrast with @option{--enable-shared}, which affects @emph{target} libraries. +@item --disable-host-pch-support +Specify that the c-family compilers should be built without support for +Pre-Compiled-Headers (PCH). The compilers will generate stub pch files +(to avoid breaking build scripts), but ignore these (or any existing PCH +files) when searching for headers. + @item @anchor{with-gnu-as}--with-gnu-as Specify that the compiler should assume that the assembler it finds is the GNU assembler. However, this does not modify -- 2.24.3 (Apple Git-128)