From patchwork Thu Nov 4 20:02:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 47069 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 699123857C6F for ; Thu, 4 Nov 2021 20:02:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 699123857C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636056178; bh=MqY2MhHJeQMgZrnHAv2pNbY49NHzDbr1/tiCuK4p/Ls=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Km58lJ0v48EdJmTaQ3wHGW/0e55TmHnLzfCNC1JFhXqqs9WtqJy/PsYGHfK9dJl+p /Sr6HuJBSWjTZxDi2ISPY4HAFM3fxWSb6etUQ4TXJFA+ZgkQIyLMEGOWxPKgh3HF2S OkNyAARJTDXitoP3fJ8kdJVsWdA26o1IaBlMB2ME= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id B84D83858439 for ; Thu, 4 Nov 2021 20:02:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B84D83858439 Received: by mail-wm1-x329.google.com with SMTP id b2-20020a1c8002000000b0032fb900951eso8078280wmd.4 for ; Thu, 04 Nov 2021 13:02:25 -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:reply-to :mime-version:content-transfer-encoding; bh=MqY2MhHJeQMgZrnHAv2pNbY49NHzDbr1/tiCuK4p/Ls=; b=RJvoyQnp6qrVc/T8yjzWmfqC61WGfZCKWF4AuDNj8Q7xxEJIqoJvmCuiPGlr9j/l3i 2gRyVo+4yhSJlACKaeHRndB2ANZqiZ3cmdX+iGm+prYQdhHKC2iVzUOAECr/Pbnj6kkd mKEntAm4mxU9OesMyZjRQPqfkEazgQlfSAKkw3r41LRHQrXCd7rs+L6p3zfYPoo/dqog KIrgkJknlGrG+niGyj4cfqjsc+KWau1oHBJ848AkUlF9ZZA1Y9okbRlqkEfG2U9HKQf7 02jMHAKfBhJBgpM3tiubLJpkxa+hQsOnQLWNHuuOTNPMH/UruOFSZnORfbJkZ6+f4j88 MhIw== X-Gm-Message-State: AOAM531+M+oLy+LFYJ55Qb1pZ5FPKIrD0a5MVyWxKDuGCkpTD9GewNFr M7n7I/kWr7UnQ0wH9YveYQ5brIyMZKQ= X-Google-Smtp-Source: ABdhPJxOqIzcFNb74z9S2QwWGph9BsGRi1LvVjM3KPMic+DmjKi9lk78WPbRI/ThRc4M0bwnBD0F6Q== X-Received: by 2002:a05:600c:2e46:: with SMTP id q6mr25095611wmf.6.1636056144657; Thu, 04 Nov 2021 13:02:24 -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) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/4] config: Allow a host to opt out of PCH. Date: Thu, 4 Nov 2021 20:02:14 +0000 Message-Id: <20211104200218.24159-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" GCC (currently) has an implementation of pre-compiled-headers, that relies on being able to launch the compiler executable at the same address each time. This constraint is not permitted by some system security models. The facility is an optimisation; saving the output of parsing a covering header file (that may include many others) so that the parsing need not be repeated when the same set of headers is needed in many places in a project. The patch series disables the operation of the PCH-related command lines, but does not cause an error to be emitted. The intent is that build recipes that expect PCH to work will continue to operate, but the compiler no longer acts on them and therefore is no longer bound to the requirement to launch at a fixed address. * When invoked to "generate PCH" the compiler will carry out the parsing as before - producing any diagnostics if relevant and then saving a stub file (to satisfy build recipe targets). The stub file is marked as invalid PCH. * When an include directive is encountered, the compiler no longer checks to see if a PCH header is available. * The top-level configure option (--disable-host-pch-support) is also propagated to libstdc++ where it causes the automatic invocation of the existing --disable-libstdxx-pch. tested on x86_64-darwin, aarch64-darwin, and on x86_64, powerpc64le-linux, OK for master? thanks Iain Iain Sandoe (4): config: Add top-level flag to disable host PCH. libstdc++: Adjust build of PCH files accounting configured host support. libcpp: Honour a configuration without host support for PCH. c-family, gcc: Allow configuring without support for PCH. Makefile.def | 9 ++-- Makefile.in | 87 +++++++++++++++++++++++++-------------- configure | 42 +++++++++++++++++++ configure.ac | 35 ++++++++++++++++ gcc/c-family/c-pch.c | 23 ++++++++++- gcc/config.in | 6 +++ gcc/config/host-darwin.c | 18 ++++++++ gcc/configure | 29 ++++++++++++- gcc/configure.ac | 17 ++++++++ gcc/doc/install.texi | 6 +++ libcpp/config.in | 3 ++ libcpp/configure | 24 +++++++++++ libcpp/configure.ac | 16 +++++++ libcpp/files.c | 14 +++++++ libcpp/pch.c | 12 ++++++ libstdc++-v3/acinclude.m4 | 49 +++++++++++++--------- libstdc++-v3/configure | 71 +++++++++++++++++++++----------- libstdc++-v3/configure.ac | 11 ++++- 18 files changed, 391 insertions(+), 81 deletions(-)