From: Mike Frysinger <vapier@gentoo.org>
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 [thread overview]
Message-ID: <20210608051036.24813-3-vapier@gentoo.org> (raw)
In-Reply-To: <20210608051036.24813-1-vapier@gentoo.org>
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 <http://www.gnu.org/licenses/>. */
#include <sys/socket.h>
#ifndef __CYGWIN32__
-#include <netinet/tcp.h>
+//#include <netinet/tcp.h>
#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
next prev parent reply other threads:[~2021-06-08 5:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 5:10 [PATCH 1/3] gnulib: import various network functions Mike Frysinger
2021-06-08 5:10 ` [PATCH 2/3] sim: start unifying portability shims Mike Frysinger
2021-06-08 5:10 ` Mike Frysinger [this message]
2021-06-08 15:43 ` [PATCH 3/3] sim: dv-sockser: enable for mingw targets too John Baldwin
2021-06-08 20:58 ` Mike Frysinger
2021-09-04 7:41 ` [PATCH 1/3] gnulib: import various network functions Mike Frysinger
2021-09-07 14:49 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210608051036.24813-3-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).