From patchwork Wed Mar 31 20:50:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1460720 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F9dkC441Zz9sXG for ; Thu, 1 Apr 2021 07:50:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D323438515F4; Wed, 31 Mar 2021 20:50:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id 3B7D23857C74 for ; Wed, 31 Mar 2021 20:50:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3B7D23857C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: (qmail 4445 invoked from network); 31 Mar 2021 20:50:17 -0000 X-APM-Out-ID: 16172238170444 X-APM-Authkey: 257869/1(257869/1) 10 Received: from unknown (HELO ?192.168.1.212?) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 31 Mar 2021 20:50:17 -0000 From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH] modules : Make sure we include in system.h. Message-Id: Date: Wed, 31 Mar 2021 21:50:16 +0100 To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-16.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Cc: Nathan Sidwell Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This fixes a stage 1 bootstrap fail on some Darwin versions when the bootstrap compiler is clang / libc++ from Xcode. bootstrapped on x86_64-darwin16, x86_64-linux-gnu OK for master? thanks Iain ---- It appears that many targets include the map header transitively in other std headers included from system.h. However there are some editions of clang/libc++ in Xcode that do not, which results in a bootstrap fail - since when resolver.h is included there is then a conflict in declaring abort(). The fix is to ensure that map is pulled in by system.h and before resolver.h is included. As a precautionary measure and to alert anyone perhaps adding another header to resolver.h this patch also gates the direct includes there on !IN_GCC. c++tools/ChangeLog: * resolver.h: Do not include std headers directly when building in GCC. gcc/cp/ChangeLog: * mapper-client.cc (INCLUDE_MAP): New; require map to be included from system.h. * mapper-resolver.cc (INCLUDE_MAP): Likewise. --- c++tools/resolver.h | 2 ++ gcc/cp/mapper-client.cc | 1 + gcc/cp/mapper-resolver.cc | 1 + 3 files changed, 4 insertions(+) diff --git a/c++tools/resolver.h b/c++tools/resolver.h index 19339125b26..a9547bf6994 100644 --- a/c++tools/resolver.h +++ b/c++tools/resolver.h @@ -24,8 +24,10 @@ along with GCC; see the file COPYING3. If not see // Mapper interface for client and server bits #include "cody.hh" // C++ +#if !IN_GCC #include #include +#endif // This is a GCC class, so GCC coding conventions on new bits. class module_resolver : public Cody::Resolver diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc index 774e2b2b095..b9e02168d55 100644 --- a/gcc/cp/mapper-client.cc +++ b/gcc/cp/mapper-client.cc @@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see #endif #define INCLUDE_STRING #define INCLUDE_VECTOR +#define INCLUDE_MAP #include "system.h" #include "line-map.h" diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc index bcf6c8871e5..db443fb4948 100644 --- a/gcc/cp/mapper-resolver.cc +++ b/gcc/cp/mapper-resolver.cc @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_STRING #define INCLUDE_VECTOR #define INCLUDE_ALGORITHM +#define INCLUDE_MAP #include "system.h" // We don't want or need to be aware of networking