From patchwork Thu Nov 3 09:37:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Torbjorn SVENSSON X-Patchwork-Id: 14784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp418899wru; Thu, 3 Nov 2022 02:40:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66cRtMq9sh8kgvFSJP4tqO9Y08OvmYjMSRu09RJPnp3h3QEW0BTYP+UyvcGgze4pvJcrlv X-Received: by 2002:a17:907:aa1:b0:7ad:b286:fa25 with SMTP id bz1-20020a1709070aa100b007adb286fa25mr27510730ejc.106.1667468418671; Thu, 03 Nov 2022 02:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667468418; cv=none; d=google.com; s=arc-20160816; b=S8pVPuLnwgTXalam0HddG2z/7uS2RIJbhG/3TuqAn+TnSKhxJj9ANc5WoW4b7i459W b1yM6PeNkq3MVGfM7/cCwAbLUUcrRljjRhp7gto2a7fxetppC2AnP7Qd5+Dq0hPqoyqw zqojSkFA2HACubAthQqW8jQYID55veMLYTt/iVRiCASWkXL/VA9ynS214dkv0oTQv5Da S/JoiiuzmVjIApT9ufvQtmmu48m+lGENVmC6A+flggW377IPpVs3rqnmB8t4Q7moH960 jJDrQotyd48g9PQ/esiRUsiZ6KfottZCdhG3KYDgZHhMYkwOj1WjJEjLU8J3TNNCu3ko i8/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=MxS6l3w6BFc3binCU5ax4xvTZAuMEbLDn+6ZQVuWpKE=; b=R1ao7CO9f6/vHFgpaE1mh5d/xXGCSlwBblMyUpi3G+VYWMQ2UMfkDElCqlDfpW+0tZ G0ADYi2spCBJEPyxzJsgMtPh9RLdJMMUjM3UiE/xDVJ0XWviepHHHmR92eQRuwRS2HeT KT/Qn55GLoEo7Ze7xbOsMZcOCNGJvyXSNA7A+Gc8d/aYHCJGaRR+y33tvA38U+7qqRve YE/CXp//XA30Z0TI7W66QSaFszku/OI5Nht45+I+A3XHSr/2UaGZazxlPCIJhs4SFRyA tm3Vz4SZfZmm4EHUN3TGUtjMriFk0Fpav0x2eeu1VKh/4auEf8+bl634ICFZbl3WSOO6 0Hxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lirtUyHA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z14-20020a056402274e00b004637e16cfa4si748967edd.599.2022.11.03.02.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lirtUyHA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76F1C385840A for ; Thu, 3 Nov 2022 09:40:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76F1C385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667468417; bh=MxS6l3w6BFc3binCU5ax4xvTZAuMEbLDn+6ZQVuWpKE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=lirtUyHASfcLTY7l2b9SwShBkCMQ22bEm92f4Tnzz4bnrnoDAxxTyYroFH+z5b75b 86et9rOja/k+qpGVD2lkOKmQiJFDRAD0kf0iP14WLN0Qqh7tcsavkTfqRffElsRQ6N gnAiWEciJbKUxbB95nwvOPJGVVGuvBCYOwIj+hKM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id B50133858D26 for ; Thu, 3 Nov 2022 09:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B50133858D26 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A38AXCT028696; Thu, 3 Nov 2022 10:39:21 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3kkqfheg0y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Nov 2022 10:39:21 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DA225100039; Thu, 3 Nov 2022 10:39:16 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CE69B2171DB; Thu, 3 Nov 2022 10:39:16 +0100 (CET) Received: from jkgcxl0002.jkg.st.com (10.210.54.218) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 3 Nov 2022 10:39:15 +0100 To: Subject: [PATCH v2] c++: Use in-process client when networking is disabled Date: Thu, 3 Nov 2022 10:37:49 +0100 Message-ID: <20221103093748.2671754-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.210.54.218] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-03_01,2022-11-02_01,2022-06-22_01 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: =?utf-8?q?Torbj=C3=B6rn_SVENSSON_via_Gcc-patches?= From: Torbjorn SVENSSON Reply-To: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= Cc: nathan@acm.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748467364822891495?= X-GMAIL-MSGID: =?utf-8?q?1748467364822891495?= v1 -> v2: Updated expression in bad-mapper-3.C Ok for trunk? --- Without the patch, the output for bad-mapper-3.C would be: /src/gcc/gcc/testsuite/g++.dg/modules/bad-mapper-3.C:2:1: error: unknown Compiled Module Interface: no such module As this line is unexpected, the test case would fail. The same problem can also be seen for g++.dg/modules/bad-mapper-2.C. gcc/cp/ChangeLog: * mapper-client.cc: Use in-process client when networking is disabled. gcc/testsuite/ChangeLog: * g++.dg/modules/bad-mapper-3.C: Update dg-error pattern. Tested on Windows with arm-none-eabi for Cortex-M3 in gcc-11 tree. Co-Authored-By: Yvan ROUX Signed-off-by: Torbjörn SVENSSON --- gcc/cp/mapper-client.cc | 4 ++++ gcc/testsuite/g++.dg/modules/bad-mapper-3.C | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc index fe9544b5ba4..4dcb3a03660 100644 --- a/gcc/cp/mapper-client.cc +++ b/gcc/cp/mapper-client.cc @@ -227,6 +227,8 @@ module_client::open_module_client (location_t loc, const char *o, int fd = -1; #if CODY_NETWORKING fd = Cody::OpenLocal (&errmsg, name.c_str () + 1); +#else + errmsg = "CODY_NETWORKING disabled"; #endif if (fd >= 0) c = new module_client (fd, fd); @@ -254,6 +256,8 @@ module_client::open_module_client (location_t loc, const char *o, int fd = -1; #if CODY_NETWORKING fd = Cody::OpenInet6 (&errmsg, name.c_str (), port); +#else + errmsg = "CODY_NETWORKING disabled"; #endif name[colon] = ':'; diff --git a/gcc/testsuite/g++.dg/modules/bad-mapper-3.C b/gcc/testsuite/g++.dg/modules/bad-mapper-3.C index 9dab332ccb2..c91bb4e260c 100644 --- a/gcc/testsuite/g++.dg/modules/bad-mapper-3.C +++ b/gcc/testsuite/g++.dg/modules/bad-mapper-3.C @@ -1,6 +1,6 @@ // { dg-additional-options "-fmodules-ts -fmodule-mapper=localhost:172477262" } import unique3.bob; -// { dg-error {failed connecting mapper 'localhost:172477262'} "" { target *-*-* } 0 } +// { dg-error {failed (connecting|CODY_NETWORKING disabled) mapper 'localhost:172477262'} "" { target *-*-* } 0 } // { dg-prune-output "fatal error:" } // { dg-prune-output "failed to read" } // { dg-prune-output "compilation terminated" }