diff mbox

[review] Also check for strerror_r in gdbserver

Message ID gerrit.1572559402000.I6a67c8543cd7a28d6dc94f5986f56abcb55727fe@gnutoolchain-gerrit.osci.io
State New
Headers show

Commit Message

Simon Marchi (Code Review) Oct. 31, 2019, 10:03 p.m. UTC
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476
......................................................................

Also check for strerror_r in gdbserver

I forgot to do this in b231e86ac9608056ea837e24d42a878927f5787a

Since safe_strerror is in gdbsupport, gdbserver also needs to
check for strerror_r, although it's less critical since gdbserver
does not use threads as much.

gdb/gdbserver/ChangeLog:

2019-10-31  Christian Biesinger  <cbiesinger@google.com>

	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Also check for strerror_r.

Change-Id: I6a67c8543cd7a28d6dc94f5986f56abcb55727fe
---
M gdb/gdbserver/config.in
M gdb/gdbserver/configure
M gdb/gdbserver/configure.ac
3 files changed, 5 insertions(+), 2 deletions(-)

Comments

Simon Marchi (Code Review) Oct. 31, 2019, 10:13 p.m. UTC | #1
Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476
......................................................................


Patch Set 1: Code-Review+2

Yeah, I suppose it can't hurt to use the thread-safe version even if not needed.
Simon Marchi (Code Review) Oct. 31, 2019, 10:47 p.m. UTC | #2
Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476
......................................................................


Patch Set 2:

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476/2//COMMIT_MSG 
Commit Message:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476/2//COMMIT_MSG@11 
PS2, Line 11: 
 6 | 
 7 | Also check for strerror_r in gdbserver
 8 | 
 9 | I forgot to do this in b231e86ac9608056ea837e24d42a878927f5787a
10 | 
11 > Since safe_strerror is in gdbsupport, gdbserver also needs to
12 > check for strerror_r, although it's less critical since gdbserver
13 > does not use threads as much.
14 | 
15 | gdb/gdbserver/ChangeLog:
16 | 
17 | 2019-10-31  Christian Biesinger  <cbiesinger@google.com>
18 | 

Normally this means the check should be put into common.m4.
Simon Marchi (Code Review) Oct. 31, 2019, 11:21 p.m. UTC | #3
Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476
......................................................................


Patch Set 2:

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476/2//COMMIT_MSG 
Commit Message:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/476/2//COMMIT_MSG@11 
PS2, Line 11: 
 6 | 
 7 | Also check for strerror_r in gdbserver
 8 | 
 9 | I forgot to do this in b231e86ac9608056ea837e24d42a878927f5787a
10 | 
11 > Since safe_strerror is in gdbsupport, gdbserver also needs to
12 > check for strerror_r, although it's less critical since gdbserver
13 > does not use threads as much.
14 | 
15 | gdb/gdbserver/ChangeLog:
16 | 
17 | 2019-10-31  Christian Biesinger  <cbiesinger@google.com>
18 | 

> Normally this means the check should be put into common.m4.

Oh, thanks, let me make a new patch to move it.
diff mbox

Patch

diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 0bce18d..2984281 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -229,6 +229,9 @@ 
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index e513fc5..7bf9fa2 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -6448,7 +6448,7 @@ 
 
 fi
 
-for ac_func in getauxval pread pwrite pread64 setns
+for ac_func in getauxval pread pwrite pread64 setns strerror_r
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 7ebc9c3..44fee8b 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -90,7 +90,7 @@ 
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h)
 AC_FUNC_FORK
-AC_CHECK_FUNCS(getauxval pread pwrite pread64 setns)
+AC_CHECK_FUNCS(getauxval pread pwrite pread64 setns strerror_r)
 
 GDB_AC_COMMON