From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2ElEA/D7vmA2VAAAWB0awg (envelope-from ) for ; Tue, 08 Jun 2021 01:11:12 -0400 Received: by simark.ca (Postfix, from userid 112) id 0B71D1F163; Tue, 8 Jun 2021 01:11:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 56C8B1E939 for ; Tue, 8 Jun 2021 01:11:11 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A28663860C36 for ; Tue, 8 Jun 2021 05:11:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A28663860C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623129070; bh=o3FUUcSmaEyksl3jl9oSc6W5w0TaXH4B5okiGbdrYYc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hEao2mxDbw+5nusyQMOKCLA1UqcGKQpJvAUWQKSwV7YfRHTk8ISs7A7qWeCnf1NrN ID/2R1unp8m8++XXLIfFo00VvpGP2ftzm1Ayw45cg7n/xnfWfhMhPPDSueZi/UG/MO s36i0cBuTDXEgsRWfwGwsszeIOVTb54UVj125bwE= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id EF14138515F4 for ; Tue, 8 Jun 2021 05:10:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF14138515F4 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0A12F335D77 for ; Tue, 8 Jun 2021 05:10:42 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 3/3] sim: dv-sockser: enable for mingw targets too Date: Tue, 8 Jun 2021 01:10:36 -0400 Message-Id: <20210608051036.24813-3-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210608051036.24813-1-vapier@gentoo.org> References: <20210608051036.24813-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" We have enough functionality from gnulib now to build sockser on all platforms. --- sim/common/dv-sockser.c | 6 +++++- sim/m4/sim_ac_option_hardware.m4 | 16 +++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index 7f1cf798e4b9..f1ef22a53a8e 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -43,7 +43,7 @@ along with this program. If not, see . */ #include #ifndef __CYGWIN32__ -#include +//#include #endif #include "sim-assert.h" @@ -199,6 +199,7 @@ dv_sockser_init (SIM_DESC sd) /* Handle writes to missing client -> SIGPIPE. ??? Need a central signal management module. */ +#ifdef SIGPIPE { RETSIGTYPE (*orig) (); orig = signal (SIGPIPE, SIG_IGN); @@ -206,6 +207,7 @@ dv_sockser_init (SIM_DESC sd) if (orig != SIG_DFL && orig != SIG_IGN) signal (SIGPIPE, orig); } +#endif return SIM_RC_OK; } @@ -277,6 +279,7 @@ connected_p (SIM_DESC sd) return 0; /* Set non-blocking i/o. */ +#ifdef F_GETFL flags = fcntl (sockser_fd, F_GETFL); flags |= O_NONBLOCK | O_NDELAY; if (fcntl (sockser_fd, F_SETFL, flags) == -1) @@ -286,6 +289,7 @@ connected_p (SIM_DESC sd) sockser_fd = -1; return 0; } +#endif return 1; } diff --git a/sim/m4/sim_ac_option_hardware.m4 b/sim/m4/sim_ac_option_hardware.m4 index 75e331eb0b33..a4595cee056c 100644 --- a/sim/m4/sim_ac_option_hardware.m4 +++ b/sim/m4/sim_ac_option_hardware.m4 @@ -48,17 +48,11 @@ else *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";; esac done - # mingw does not support sockser - case ${host} in - *mingw*) ;; - *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device - # that you instatiate. Instead, other code will call into it directly. - # At some point, we should convert it over. - sim_hw_objs="$sim_hw_objs dv-sockser.o" - AC_DEFINE_UNQUOTED( - [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.]) - ;; - esac + dnl TODO: We don't add dv-sockser to sim_hw as it is not a "real" device + dnl that you instatiate. Instead, other code will call into it directly. + dnl At some point, we should convert it over. + sim_hw_objs="$sim_hw_objs dv-sockser.o" + AC_DEFINE_UNQUOTED([HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.]) if test x"$silent" != x"yes"; then echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs" fi -- 2.31.1