From patchwork Wed Dec 16 19:57:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1417381 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sRu/dfvv; dkim-atps=neutral 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 4Cx5Wb4qXWz9sT5 for ; Thu, 17 Dec 2020 06:57:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0B5B9388A42F; Wed, 16 Dec 2020 19:57:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 7295D388A42F for ; Wed, 16 Dec 2020 19:57:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7295D388A42F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x831.google.com with SMTP id b9so18372910qtr.2 for ; Wed, 16 Dec 2020 11:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=bvZ7htxbS5g4emIyf0KTXHKHmpHW7H9X2OfTYPYEvcI=; b=sRu/dfvvs7eNsyyFMhsC3QTFJE2YVz2wWapjdxe44tLV3SzIxGSHhNQ26BLBFb/Vb0 yCT5qTyoznKzyileXy1yyFg3ZLgqBF90EXl0fZfTOagsxRNl/cDZxQUmLXqwFvHZPLWi yorJEGyeWpU9fOVgRLHmZXGVKxClleOrz1+DPh2tdvCRUmKJYLIYq2L/Gj82HGEVoIiD L9kgzr10uCO53pvHYiK3KeznadEGhHB41zLlN3+xmhS+B2jocwjmwS7uSP8CHFReHnFg tb+kk2hJbAs8hRxhf25z+1OkbGHtQf2xSF+k1ZiHUOI4IzWL/vWHBhGzKx7zy7QQZH7k BTUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=bvZ7htxbS5g4emIyf0KTXHKHmpHW7H9X2OfTYPYEvcI=; b=Y7DM4/VGvAmW6cB75tQX9lug17yPJXouBWnbUGsu8cwzCQ1fsa3KDCCrjQ1sM7ZGOm 3eWzIUN5XbA19Z9gOZZJuBGC8QyxaqS72ZX9AXyN9mZBvLdQlUAWUkJtcFbW20Dic6X2 e+Y8ag3lCOXYFYs7QS5LZ0I1IlFGEekINAeMCYhm80f7+o5rgkasjzLgm3LXSAeM9EBu oweVPOx8Z6hVs2u6ZuuU/uxvIUlchmMHUv5dpJEo9GTKE9uA7l3u058AOVzqlIAn5PLt 8o62xExahubzx65cHel1BFoCeiF1KpYh1rXc0H3hln0ayLwFgRhWA8xBxdjknfSLioAr SEJA== X-Gm-Message-State: AOAM531kJzQj71KgnNy2u2v6CNKFaF2DB0oue1WZGeNccq4XPPrF+f9h NTG1WbtMc+Ljnhum6ECqOQI= X-Google-Smtp-Source: ABdhPJxdsdajtZ4Uvr8z5Hs48lOLvtmMVY/eT7mxJHA/d1XLwGpsyO0vIPlqtD9m73kBgWEbqP6pbw== X-Received: by 2002:ac8:7352:: with SMTP id q18mr42215971qtp.167.1608148645759; Wed, 16 Dec 2020 11:57:25 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:e0c4:86e9:6418:b0da? ([2620:10d:c091:480::1:c154]) by smtp.googlemail.com with ESMTPSA id w22sm1629711qtt.76.2020.12.16.11.57.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Dec 2020 11:57:24 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: c++: Another solaris header use [PR 98315] Message-ID: Date: Wed, 16 Dec 2020 14:57:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Rather than early-include sys/socket.h, let's allow the includer to tell cody no networking. libcody/ * cody.hh: Allow user to set CODY_NETWORKING. gcc/cp/ * mapper-resolver.cc: Remove early include of sys/socket.h. Specify no CODY_NETWORKING instead. * module.cc: Specify no CODY_NETWORKING. pushing to trunk diff --git i/gcc/cp/mapper-resolver.cc w/gcc/cp/mapper-resolver.cc index 8e968c52556..53c482441b4 100644 --- i/gcc/cp/mapper-resolver.cc +++ w/gcc/cp/mapper-resolver.cc @@ -21,13 +21,9 @@ along with GCC; see the file COPYING3. If not see /* Forward to the resolver in c++tools. */ #include "config.h" -#if defined (__unix__) -// Solaris11's socket header used bcopy, which we poison. cody.hh -// will include it later under the above check -#include -#endif - #define INCLUDE_ALGORITHM #include "system.h" +// We don't want or need to be aware of networking +#define CODY_NETWORKING 0 #include "../../c++tools/resolver.cc" diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index e9ea18636b4..2318489d9d4 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -207,7 +207,6 @@ Classes used: #define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available. */ #include "config.h" - #include "system.h" #include "coretypes.h" #include "cp-tree.h" @@ -229,6 +228,8 @@ Classes used: #include "attribs.h" #include "intl.h" #include "langhooks.h" +/* This TU doesn't need or want to see the networking. */ +#define CODY_NETWORKING 0 #include "mapper-client.h" #if HAVE_MMAP_FILE && _POSIX_MAPPED_FILES > 0 diff --git i/libcody/cody.hh w/libcody/cody.hh index 31d9c182cbe..789ce9e70b7 100644 --- i/libcody/cody.hh +++ w/libcody/cody.hh @@ -5,6 +5,9 @@ #ifndef CODY_HH #define CODY_HH 1 +// If the user specifies this as non-zero, it must be what we expect, +// generally only good for requesting no networking +#if !defined (CODY_NETWORKING) // Have a known-good list of networking systems #if defined (__unix__) || defined (__MACH__) #define CODY_NETWORKING 1 @@ -15,6 +18,7 @@ #undef CODY_NETWORKING #define CODY_NETWORKING 0 #endif +#endif // C++ #include