public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gnulib: import sys_wait
@ 2021-06-13  5:25 Mike Frysinger
  2021-06-14 12:18 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Mike Frysinger @ 2021-06-13  5:25 UTC (permalink / raw)
  To: gdb-patches

A few sims use this to emulate process syscalls.
---
 gnulib/Makefile.in               |   4 +
 gnulib/aclocal.m4                |   1 +
 gnulib/config.in                 |   3 +
 gnulib/configure                 |  99 +++++++++++++++++++++++
 gnulib/import/Makefile.am        |  29 +++++++
 gnulib/import/Makefile.in        |  35 +++++++--
 gnulib/import/m4/gnulib-cache.m4 |   2 +
 gnulib/import/m4/gnulib-comp.m4  |   5 ++
 gnulib/import/m4/sys_wait_h.m4   |  36 +++++++++
 gnulib/import/sys_wait.in.h      | 131 +++++++++++++++++++++++++++++++
 gnulib/update-gnulib.sh          |   1 +
 11 files changed, 340 insertions(+), 6 deletions(-)
 create mode 100644 gnulib/import/m4/sys_wait_h.m4
 create mode 100644 gnulib/import/sys_wait.in.h

diff --git a/gnulib/Makefile.in b/gnulib/Makefile.in
index e1b9b34a794e..af264c3c12de 100644
--- a/gnulib/Makefile.in
+++ b/gnulib/Makefile.in
@@ -265,6 +265,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/import/m4/sys_time_h.m4 \
 	$(top_srcdir)/import/m4/sys_types_h.m4 \
 	$(top_srcdir)/import/m4/sys_uio_h.m4 \
+	$(top_srcdir)/import/m4/sys_wait_h.m4 \
 	$(top_srcdir)/import/m4/tempname.m4 \
 	$(top_srcdir)/import/m4/threadlib.m4 \
 	$(top_srcdir)/import/m4/time_h.m4 \
@@ -813,6 +814,7 @@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
 GNULIB_VSCANF = @GNULIB_VSCANF@
 GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
 GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
 GNULIB_WCPCPY = @GNULIB_WCPCPY@
 GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
 GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
@@ -1307,6 +1309,7 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
@@ -1338,6 +1341,7 @@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
 NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
diff --git a/gnulib/aclocal.m4 b/gnulib/aclocal.m4
index 83780b641ac4..c03dc8bcafa7 100644
--- a/gnulib/aclocal.m4
+++ b/gnulib/aclocal.m4
@@ -1338,6 +1338,7 @@ m4_include([import/m4/sys_stat_h.m4])
 m4_include([import/m4/sys_time_h.m4])
 m4_include([import/m4/sys_types_h.m4])
 m4_include([import/m4/sys_uio_h.m4])
+m4_include([import/m4/sys_wait_h.m4])
 m4_include([import/m4/tempname.m4])
 m4_include([import/m4/threadlib.m4])
 m4_include([import/m4/time_h.m4])
diff --git a/gnulib/config.in b/gnulib/config.in
index a90ddd611823..db04597320eb 100644
--- a/gnulib/config.in
+++ b/gnulib/config.in
@@ -901,6 +901,9 @@
 /* Define to 1 if you have the <sys/uio.h> header file. */
 #undef HAVE_SYS_UIO_H
 
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
 /* Define to 1 if you have the `thrd_create' function. */
 #undef HAVE_THRD_CREATE
 
diff --git a/gnulib/configure b/gnulib/configure
index 73a38082960a..c212281bca5b 100644
--- a/gnulib/configure
+++ b/gnulib/configure
@@ -732,6 +732,9 @@ GNULIB_NANOSLEEP
 GNULIB_LOCALTIME
 GNULIB_MKTIME
 GNULIB_CTIME
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
+NEXT_SYS_WAIT_H
+GNULIB_WAITPID
 HAVE_SYS_UIO_H
 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
 NEXT_SYS_UIO_H
@@ -3802,6 +3805,7 @@ as_fn_append ac_func_list " snprintf"
 as_fn_append ac_header_list " strings.h"
 as_fn_append ac_header_list " sys/random.h"
 as_fn_append ac_header_list " sys/uio.h"
+as_fn_append ac_header_list " sys/wait.h"
 as_fn_append ac_func_list " localtime_r"
 as_fn_append ac_header_list " crtdefs.h"
 as_fn_append ac_func_list " iswcntrl"
@@ -6865,6 +6869,7 @@ fi
   # Code from module sys_time:
   # Code from module sys_types:
   # Code from module sys_uio:
+  # Code from module sys_wait:
   # Code from module tempname:
   # Code from module threadlib:
 
@@ -17767,6 +17772,11 @@ $as_echo "$gl_cv_next_sys_types_h" >&6; }
 
 
 
+  GNULIB_WAITPID=0;
+
+
+
+
   GNULIB_CTIME=0;
   GNULIB_MKTIME=0;
   GNULIB_LOCALTIME=0;
@@ -30722,6 +30732,95 @@ $as_echo "$gl_cv_next_sys_uio_h" >&6; }
 
 
 
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
+$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; }
+if ${gl_cv_next_sys_wait_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_sys_wait_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/wait.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/wait.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_sys_wait_h
+           gl_cv_next_sys_wait_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
+$as_echo "$gl_cv_next_sys_wait_h" >&6; }
+     fi
+     NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/wait.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_wait_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
   :
 
 
diff --git a/gnulib/import/Makefile.am b/gnulib/import/Makefile.am
index 1ae25ac28050..dafe63d4c8a6 100644
--- a/gnulib/import/Makefile.am
+++ b/gnulib/import/Makefile.am
@@ -71,6 +71,7 @@
 #  strstr \
 #  strtok_r \
 #  sys_stat \
+#  sys_wait \
 #  time_r \
 #  unistd \
 #  unsetenv \
@@ -2755,6 +2756,34 @@ EXTRA_DIST += sys_uio.in.h
 
 ## end   gnulib module sys_uio
 
+## begin gnulib module sys_wait
+
+BUILT_SOURCES += sys/wait.h
+
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+	$(AM_V_at)$(MKDIR_P) sys
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+	      -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+	      -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+	      < $(srcdir)/sys_wait.in.h; \
+	} > $@-t && \
+	mv $@-t $@
+MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_wait.in.h
+
+## end   gnulib module sys_wait
+
 ## begin gnulib module tempname
 
 libgnu_a_SOURCES += tempname.c
diff --git a/gnulib/import/Makefile.in b/gnulib/import/Makefile.in
index e9b52a7d4fc3..aae971154094 100644
--- a/gnulib/import/Makefile.in
+++ b/gnulib/import/Makefile.in
@@ -85,6 +85,7 @@
 #  strstr \
 #  strtok_r \
 #  sys_stat \
+#  sys_wait \
 #  time_r \
 #  unistd \
 #  unsetenv \
@@ -329,6 +330,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/import/m4/sys_time_h.m4 \
 	$(top_srcdir)/import/m4/sys_types_h.m4 \
 	$(top_srcdir)/import/m4/sys_uio_h.m4 \
+	$(top_srcdir)/import/m4/sys_wait_h.m4 \
 	$(top_srcdir)/import/m4/tempname.m4 \
 	$(top_srcdir)/import/m4/threadlib.m4 \
 	$(top_srcdir)/import/m4/time_h.m4 \
@@ -915,6 +917,7 @@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
 GNULIB_VSCANF = @GNULIB_VSCANF@
 GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
 GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
 GNULIB_WCPCPY = @GNULIB_WCPCPY@
 GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
 GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
@@ -1409,6 +1412,7 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
@@ -1440,6 +1444,7 @@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
 NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
@@ -1856,8 +1861,8 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h arpa_inet.in.h \
 	string.in.h strings.in.h strnlen.c strstr.c str-two-way.h \
 	strstr.c strtok_r.c sys_random.in.h sys_select.in.h \
 	sys_socket.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \
-	sys_uio.in.h tempname.h time.in.h time_r.c unistd.in.h \
-	unistd--.h unistd-safer.h unsetenv.c \
+	sys_uio.in.h sys_wait.in.h tempname.h time.in.h time_r.c \
+	unistd.in.h unistd--.h unistd-safer.h unsetenv.c \
 	$(top_srcdir)/import/extra/update-copyright verify.h \
 	wchar.in.h wctype.in.h windows-initguard.h windows-mutex.c \
 	windows-mutex.h windows-once.c windows-once.h \
@@ -1870,7 +1875,7 @@ BUILT_SOURCES = $(ALLOCA_H) arpa/inet.h ctype.h dirent.h $(ERRNO_H) \
 	$(STDALIGN_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \
 	stdlib.h string.h strings.h sys/random.h sys/select.h \
 	sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h \
-	time.h unistd.h wchar.h wctype.h
+	sys/wait.h time.h unistd.h wchar.h wctype.h
 SUFFIXES = 
 MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
 	arpa/inet.h-t ctype.h ctype.h-t dirent.h dirent.h-t errno.h \
@@ -1884,9 +1889,9 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
 	sys/random.h sys/random.h-t sys/select.h sys/select.h-t \
 	sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h \
 	sys/time.h-t sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t \
-	time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
-	wctype.h-t
-MOSTLYCLEANDIRS = arpa netinet sys sys sys sys sys
+	sys/wait.h sys/wait.h-t time.h time.h-t unistd.h unistd.h-t \
+	wchar.h wchar.h-t wctype.h wctype.h-t
+MOSTLYCLEANDIRS = arpa netinet sys sys sys sys sys sys
 CLEANFILES = 
 DISTCLEANFILES = 
 MAINTAINERCLEANFILES = 
@@ -3744,6 +3749,24 @@ sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
 	} > $@-t && \
 	mv -f $@-t $@
 
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+	$(AM_V_at)$(MKDIR_P) sys
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+	      -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+	      -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+	      < $(srcdir)/sys_wait.in.h; \
+	} > $@-t && \
+	mv $@-t $@
+
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
 time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
diff --git a/gnulib/import/m4/gnulib-cache.m4 b/gnulib/import/m4/gnulib-cache.m4
index 689ebd3e5ba9..53968404dca4 100644
--- a/gnulib/import/m4/gnulib-cache.m4
+++ b/gnulib/import/m4/gnulib-cache.m4
@@ -76,6 +76,7 @@
 #  strstr \
 #  strtok_r \
 #  sys_stat \
+#  sys_wait \
 #  time_r \
 #  unistd \
 #  unsetenv \
@@ -124,6 +125,7 @@ gl_MODULES([
   strstr
   strtok_r
   sys_stat
+  sys_wait
   time_r
   unistd
   unsetenv
diff --git a/gnulib/import/m4/gnulib-comp.m4 b/gnulib/import/m4/gnulib-comp.m4
index 03eff90b6b2d..54ae5bbbcf21 100644
--- a/gnulib/import/m4/gnulib-comp.m4
+++ b/gnulib/import/m4/gnulib-comp.m4
@@ -213,6 +213,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module sys_time:
   # Code from module sys_types:
   # Code from module sys_uio:
+  # Code from module sys_wait:
   # Code from module tempname:
   # Code from module threadlib:
   gl_THREADLIB_EARLY
@@ -777,6 +778,8 @@ AC_DEFUN([gl_INIT],
   AC_PROG_MKDIR_P
   gl_HEADER_SYS_UIO
   AC_PROG_MKDIR_P
+  gl_SYS_WAIT_H
+  AC_PROG_MKDIR_P
   gl_FUNC_GEN_TEMPNAME
   gl_MODULE_INDICATOR([tempname])
   AC_REQUIRE([gl_THREADLIB])
@@ -1184,6 +1187,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/sys_time.in.h
   lib/sys_types.in.h
   lib/sys_uio.in.h
+  lib/sys_wait.in.h
   lib/tempname.c
   lib/tempname.h
   lib/time.in.h
@@ -1365,6 +1369,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/sys_time_h.m4
   m4/sys_types_h.m4
   m4/sys_uio_h.m4
+  m4/sys_wait_h.m4
   m4/tempname.m4
   m4/threadlib.m4
   m4/time_h.m4
diff --git a/gnulib/import/m4/sys_wait_h.m4 b/gnulib/import/m4/sys_wait_h.m4
new file mode 100644
index 000000000000..96e9ba2b1247
--- /dev/null
+++ b/gnulib/import/m4/sys_wait_h.m4
@@ -0,0 +1,36 @@
+# sys_wait_h.m4 serial 6
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SYS_WAIT_H],
+[
+  AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+
+  dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([sys/wait.h])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
+    [waitpid])
+])
+
+AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
+[
+  GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+])
diff --git a/gnulib/import/sys_wait.in.h b/gnulib/import/sys_wait.in.h
new file mode 100644
index 000000000000..25d25a0ae1be
--- /dev/null
+++ b/gnulib/import/sys_wait.in.h
@@ -0,0 +1,131 @@
+/* A POSIX-like <sys/wait.h>.
+   Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard.  */
+#if !(defined _WIN32 && ! defined __CYGWIN__)
+# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+#define _@GUARD_PREFIX@_SYS_WAIT_H
+
+/* Get pid_t.  */
+#include <sys/types.h>
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+#if !(defined _WIN32 && ! defined __CYGWIN__)
+/* Unix API.  */
+
+/* The following macros apply to an argument x, that is a status of a process,
+   as returned by waitpid().
+   On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and
+   WTERMSIG are bits 7..0, while BeOS uses the opposite.  Therefore programs
+   have to use the abstract macros.  */
+
+/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x)
+   is true.  */
+# ifndef WIFSIGNALED
+#  define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f)
+# endif
+# ifndef WIFEXITED
+#  define WIFEXITED(x) (WTERMSIG (x) == 0)
+# endif
+# ifndef WIFSTOPPED
+#  define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f)
+# endif
+
+/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true.  */
+# ifndef WTERMSIG
+#  define WTERMSIG(x) ((x) & 0x7f)
+# endif
+
+/* The exit status. Only to be accessed if WIFEXITED(x) is true.  */
+# ifndef WEXITSTATUS
+#  define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+# endif
+
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true.  */
+# ifndef WSTOPSIG
+#  define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
+/* True if the process dumped core.  Not standardized by POSIX.  */
+# ifndef WCOREDUMP
+#  define WCOREDUMP(x) ((x) & 0x80)
+# endif
+
+#else
+/* Native Windows API.  */
+
+# include <signal.h> /* for SIGTERM */
+
+/* The following macros apply to an argument x, that is a status of a process,
+   as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
+   This value is simply an 'int', not composed of bit fields.  */
+
+/* When an unhandled fatal signal terminates a process, the exit code is 3.  */
+# define WIFSIGNALED(x) ((x) == 3)
+# define WIFEXITED(x) ((x) != 3)
+# define WIFSTOPPED(x) 0
+
+/* The signal that terminated a process is not known posthum.  */
+# define WTERMSIG(x) SIGTERM
+
+# define WEXITSTATUS(x) (x)
+
+/* There are no stopping signals.  */
+# define WSTOPSIG(x) 0
+
+/* There are no core dumps.  */
+# define WCOREDUMP(x) 0
+
+#endif
+
+
+/* Declarations of functions.  */
+
+#if @GNULIB_WAITPID@
+# if defined _WIN32 && ! defined __CYGWIN__
+_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+# endif
+/* Need to cast, because on Cygwin, the second parameter is
+                                                __wait_status_ptr_t statusp.  */
+_GL_CXXALIAS_SYS_CAST (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+_GL_CXXALIASWARN (waitpid);
+#elif defined GNULIB_POSIXCHECK
+# undef waitpid
+# if HAVE_RAW_DECL_WAITPID
+_GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
+                 "use gnulib module sys_wait for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
diff --git a/gnulib/update-gnulib.sh b/gnulib/update-gnulib.sh
index 08c43fcfc143..e5c6fd90dd76 100755
--- a/gnulib/update-gnulib.sh
+++ b/gnulib/update-gnulib.sh
@@ -68,6 +68,7 @@ IMPORTED_GNULIB_MODULES="\
     strstr \
     strtok_r \
     sys_stat \
+    sys_wait \
     time_r \
     unistd \
     unsetenv \
-- 
2.31.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-13  5:25 [PATCH] gnulib: import sys_wait Mike Frysinger
@ 2021-06-14 12:18 ` Eli Zaretskii
  2021-06-14 14:35   ` Mike Frysinger
  2021-06-30  7:03 ` Mike Frysinger
  2021-09-03 20:54 ` Simon Marchi
  2 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2021-06-14 12:18 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

> Date: Sun, 13 Jun 2021 01:25:19 -0400
> From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
> 
> +/* Native Windows API.  */
> +
> +# include <signal.h> /* for SIGTERM */
> +
> +/* The following macros apply to an argument x, that is a status of a process,
> +   as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
> +   This value is simply an 'int', not composed of bit fields.  */
> +
> +/* When an unhandled fatal signal terminates a process, the exit code is 3.  */
> +# define WIFSIGNALED(x) ((x) == 3)
> +# define WIFEXITED(x) ((x) != 3)
> +# define WIFSTOPPED(x) 0
> +
> +/* The signal that terminated a process is not known posthum.  */
> +# define WTERMSIG(x) SIGTERM
> +
> +# define WEXITSTATUS(x) (x)
> +
> +/* There are no stopping signals.  */
> +# define WSTOPSIG(x) 0
> +
> +/* There are no core dumps.  */
> +# define WCOREDUMP(x) 0

AFAIU, this conflicts with what we have in gdbsupport/gdb_wait.h and
use in windows-nat.c and win32-low.cc.  Worse, the Gnulib emulation of
this for Windows is (IMNSHO) less useful, since it doesn't support any
abnormal termination except the equivalent of SIGABRT (which causes
the Windows runtime to exit with status = 3).  I tried to convince the
Gnulib folks to adopt a more useful emulation, similar to what we have
in gdb_wait.h, but AFAIR Bruno Haible rejected the idea.

Did you need this Gnulib module because those sims don't use
gdbsupport?  And if so, is it possible to somehow avoid clashes
between this Gnulib module and what we have in gdb_wait.h?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-14 12:18 ` Eli Zaretskii
@ 2021-06-14 14:35   ` Mike Frysinger
  2021-06-14 14:43     ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2021-06-14 14:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 14 Jun 2021 15:18, Eli Zaretskii wrote:
> > Date: Sun, 13 Jun 2021 01:25:19 -0400
> > From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
> > 
> > +/* Native Windows API.  */
> > +
> > +# include <signal.h> /* for SIGTERM */
> > +
> > +/* The following macros apply to an argument x, that is a status of a process,
> > +   as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
> > +   This value is simply an 'int', not composed of bit fields.  */
> > +
> > +/* When an unhandled fatal signal terminates a process, the exit code is 3.  */
> > +# define WIFSIGNALED(x) ((x) == 3)
> > +# define WIFEXITED(x) ((x) != 3)
> > +# define WIFSTOPPED(x) 0
> > +
> > +/* The signal that terminated a process is not known posthum.  */
> > +# define WTERMSIG(x) SIGTERM
> > +
> > +# define WEXITSTATUS(x) (x)
> > +
> > +/* There are no stopping signals.  */
> > +# define WSTOPSIG(x) 0
> > +
> > +/* There are no core dumps.  */
> > +# define WCOREDUMP(x) 0
> 
> AFAIU, this conflicts with what we have in gdbsupport/gdb_wait.h and
> use in windows-nat.c and win32-low.cc.  Worse, the Gnulib emulation of
> this for Windows is (IMNSHO) less useful, since it doesn't support any
> abnormal termination except the equivalent of SIGABRT (which causes
> the Windows runtime to exit with status = 3).  I tried to convince the
> Gnulib folks to adopt a more useful emulation, similar to what we have
> in gdb_wait.h, but AFAIR Bruno Haible rejected the idea.

i don't think there's any conflicts.  gdb* dirs probe the env w/out gnulib,
so they'll see sys/wait.h is not available, and then the gdb_wait.h and such
files will continue to be used.

> Did you need this Gnulib module because those sims don't use
> gdbsupport?  And if so, is it possible to somehow avoid clashes
> between this Gnulib module and what we have in gdb_wait.h?

sim/ doesn't use gdbsupport/.  the gdbsupport/ dir assumes it's used with
only gdb/, and is C++, so i don't think trying to generalize it is worth
the effort.
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-14 14:35   ` Mike Frysinger
@ 2021-06-14 14:43     ` Eli Zaretskii
  2021-06-14 19:35       ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2021-06-14 14:43 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

> Date: Mon, 14 Jun 2021 10:35:07 -0400
> From: Mike Frysinger <vapier@gentoo.org>
> Cc: gdb-patches@sourceware.org
> 
> > AFAIU, this conflicts with what we have in gdbsupport/gdb_wait.h and
> > use in windows-nat.c and win32-low.cc.  Worse, the Gnulib emulation of
> > this for Windows is (IMNSHO) less useful, since it doesn't support any
> > abnormal termination except the equivalent of SIGABRT (which causes
> > the Windows runtime to exit with status = 3).  I tried to convince the
> > Gnulib folks to adopt a more useful emulation, similar to what we have
> > in gdb_wait.h, but AFAIR Bruno Haible rejected the idea.
> 
> i don't think there's any conflicts.  gdb* dirs probe the env w/out gnulib,
> so they'll see sys/wait.h is not available, and then the gdb_wait.h and such
> files will continue to be used.
> 
> > Did you need this Gnulib module because those sims don't use
> > gdbsupport?  And if so, is it possible to somehow avoid clashes
> > between this Gnulib module and what we have in gdb_wait.h?
> 
> sim/ doesn't use gdbsupport/.  the gdbsupport/ dir assumes it's used with
> only gdb/, and is C++, so i don't think trying to generalize it is worth
> the effort.

OK, if there are no conflicts here, then apologies for the noise.  (I
never build the sim subdirectory in my builds of GDB.)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-14 14:43     ` Eli Zaretskii
@ 2021-06-14 19:35       ` Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2021-06-14 19:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 14 Jun 2021 17:43, Eli Zaretskii wrote:
> > Date: Mon, 14 Jun 2021 10:35:07 -0400
> > From: Mike Frysinger <vapier@gentoo.org>
> > Cc: gdb-patches@sourceware.org
> > 
> > > AFAIU, this conflicts with what we have in gdbsupport/gdb_wait.h and
> > > use in windows-nat.c and win32-low.cc.  Worse, the Gnulib emulation of
> > > this for Windows is (IMNSHO) less useful, since it doesn't support any
> > > abnormal termination except the equivalent of SIGABRT (which causes
> > > the Windows runtime to exit with status = 3).  I tried to convince the
> > > Gnulib folks to adopt a more useful emulation, similar to what we have
> > > in gdb_wait.h, but AFAIR Bruno Haible rejected the idea.
> > 
> > i don't think there's any conflicts.  gdb* dirs probe the env w/out gnulib,
> > so they'll see sys/wait.h is not available, and then the gdb_wait.h and such
> > files will continue to be used.
> > 
> > > Did you need this Gnulib module because those sims don't use
> > > gdbsupport?  And if so, is it possible to somehow avoid clashes
> > > between this Gnulib module and what we have in gdb_wait.h?
> > 
> > sim/ doesn't use gdbsupport/.  the gdbsupport/ dir assumes it's used with
> > only gdb/, and is C++, so i don't think trying to generalize it is worth
> > the effort.
> 
> OK, if there are no conflicts here, then apologies for the noise.  (I
> never build the sim subdirectory in my builds of GDB.)

np, it's good to double check these nuances

i've verified that gdb & gdbsupport don't detect sys/wait.h for a mingw build,
and the gdb_wait file is compiled.  i don't have a way of checking the gdb.exe
though.
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-13  5:25 [PATCH] gnulib: import sys_wait Mike Frysinger
  2021-06-14 12:18 ` Eli Zaretskii
@ 2021-06-30  7:03 ` Mike Frysinger
  2021-08-18 16:19   ` Mike Frysinger
  2021-09-03 20:54 ` Simon Marchi
  2 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2021-06-30  7:03 UTC (permalink / raw)
  To: gdb-patches

On 13 Jun 2021 01:25, Mike Frysinger via Gdb-patches wrote:
> A few sims use this to emulate process syscalls.

were there any concerns with merging this ?
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-30  7:03 ` Mike Frysinger
@ 2021-08-18 16:19   ` Mike Frysinger
  2021-09-04  1:15     ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2021-08-18 16:19 UTC (permalink / raw)
  To: gdb-patches

On 30 Jun 2021 03:03, Mike Frysinger via Gdb-patches wrote:
> On 13 Jun 2021 01:25, Mike Frysinger via Gdb-patches wrote:
> > A few sims use this to emulate process syscalls.
> 
> were there any concerns with merging this ?

ping ...
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-06-13  5:25 [PATCH] gnulib: import sys_wait Mike Frysinger
  2021-06-14 12:18 ` Eli Zaretskii
  2021-06-30  7:03 ` Mike Frysinger
@ 2021-09-03 20:54 ` Simon Marchi
  2021-09-04  7:41   ` Mike Frysinger
  2 siblings, 1 reply; 14+ messages in thread
From: Simon Marchi @ 2021-09-03 20:54 UTC (permalink / raw)
  To: Mike Frysinger, gdb-patches

On 2021-06-13 1:25 a.m., Mike Frysinger via Gdb-patches wrote:
> A few sims use this to emulate process syscalls.
>  gnulib/Makefile.in               |   4 +
>  gnulib/aclocal.m4                |   1 +
>  gnulib/config.in                 |   3 +
>  gnulib/configure                 |  99 +++++++++++++++++++++++
>  gnulib/import/Makefile.am        |  29 +++++++
>  gnulib/import/Makefile.in        |  35 +++++++--
>  gnulib/import/m4/gnulib-cache.m4 |   2 +
>  gnulib/import/m4/gnulib-comp.m4  |   5 ++
>  gnulib/import/m4/sys_wait_h.m4   |  36 +++++++++
>  gnulib/import/sys_wait.in.h      | 131 +++++++++++++++++++++++++++++++
>  gnulib/update-gnulib.sh          |   1 +
>  11 files changed, 340 insertions(+), 6 deletions(-)
>  create mode 100644 gnulib/import/m4/sys_wait_h.m4
>  create mode 100644 gnulib/import/sys_wait.in.h

I don't really know how to assess the risks of merging this, how things
could go wrong.  But intuitively I think it should be relatively safe.
I'd say go ahead and merge it.

Simon

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-08-18 16:19   ` Mike Frysinger
@ 2021-09-04  1:15     ` Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2021-09-04  1:15 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On 18 Aug 2021 12:19, Mike Frysinger via Gdb-patches wrote:
> On 30 Jun 2021 03:03, Mike Frysinger via Gdb-patches wrote:
> > On 13 Jun 2021 01:25, Mike Frysinger via Gdb-patches wrote:
> > > A few sims use this to emulate process syscalls.
> > 
> > were there any concerns with merging this ?
> 
> ping ...

ping ...
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-09-03 20:54 ` Simon Marchi
@ 2021-09-04  7:41   ` Mike Frysinger
  2021-09-07 14:51     ` Simon Marchi
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2021-09-04  7:41 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

On 03 Sep 2021 16:54, Simon Marchi wrote:
> On 2021-06-13 1:25 a.m., Mike Frysinger via Gdb-patches wrote:
> > A few sims use this to emulate process syscalls.
> >  gnulib/Makefile.in               |   4 +
> >  gnulib/aclocal.m4                |   1 +
> >  gnulib/config.in                 |   3 +
> >  gnulib/configure                 |  99 +++++++++++++++++++++++
> >  gnulib/import/Makefile.am        |  29 +++++++
> >  gnulib/import/Makefile.in        |  35 +++++++--
> >  gnulib/import/m4/gnulib-cache.m4 |   2 +
> >  gnulib/import/m4/gnulib-comp.m4  |   5 ++
> >  gnulib/import/m4/sys_wait_h.m4   |  36 +++++++++
> >  gnulib/import/sys_wait.in.h      | 131 +++++++++++++++++++++++++++++++
> >  gnulib/update-gnulib.sh          |   1 +
> >  11 files changed, 340 insertions(+), 6 deletions(-)
> >  create mode 100644 gnulib/import/m4/sys_wait_h.m4
> >  create mode 100644 gnulib/import/sys_wait.in.h
> 
> I don't really know how to assess the risks of merging this, how things
> could go wrong.  But intuitively I think it should be relatively safe.
> I'd say go ahead and merge it.

i feel like this could be a review for every patch ;)

we just branched gdb, so should be a good amount of time to let it bake
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-09-04  7:41   ` Mike Frysinger
@ 2021-09-07 14:51     ` Simon Marchi
  2021-09-08  0:55       ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Simon Marchi @ 2021-09-07 14:51 UTC (permalink / raw)
  To: gdb-patches

On 2021-09-04 3:41 a.m., Mike Frysinger wrote:
> On 03 Sep 2021 16:54, Simon Marchi wrote:
>> On 2021-06-13 1:25 a.m., Mike Frysinger via Gdb-patches wrote:
>>> A few sims use this to emulate process syscalls.
>>>  gnulib/Makefile.in               |   4 +
>>>  gnulib/aclocal.m4                |   1 +
>>>  gnulib/config.in                 |   3 +
>>>  gnulib/configure                 |  99 +++++++++++++++++++++++
>>>  gnulib/import/Makefile.am        |  29 +++++++
>>>  gnulib/import/Makefile.in        |  35 +++++++--
>>>  gnulib/import/m4/gnulib-cache.m4 |   2 +
>>>  gnulib/import/m4/gnulib-comp.m4  |   5 ++
>>>  gnulib/import/m4/sys_wait_h.m4   |  36 +++++++++
>>>  gnulib/import/sys_wait.in.h      | 131 +++++++++++++++++++++++++++++++
>>>  gnulib/update-gnulib.sh          |   1 +
>>>  11 files changed, 340 insertions(+), 6 deletions(-)
>>>  create mode 100644 gnulib/import/m4/sys_wait_h.m4
>>>  create mode 100644 gnulib/import/sys_wait.in.h
>>
>> I don't really know how to assess the risks of merging this, how things
>> could go wrong.  But intuitively I think it should be relatively safe.
>> I'd say go ahead and merge it.
> 
> i feel like this could be a review for every patch ;)

Haha, indeed, that would make life easier.

I meant that maybe somebody knows that we don't want to import a
particular module for some particular reason, a bit like what Eli said.
There might be some instances of this, but if so they should be
documented in gnulib/README, because there's no way to guess otherwise.

> 
> we just branched gdb, so should be a good amount of time to let it bake

Agreed.

Simon

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-09-07 14:51     ` Simon Marchi
@ 2021-09-08  0:55       ` Mike Frysinger
  2021-09-08 14:41         ` Simon Marchi
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2021-09-08  0:55 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

On 07 Sep 2021 10:51, Simon Marchi via Gdb-patches wrote:
> On 2021-09-04 3:41 a.m., Mike Frysinger wrote:
> > On 03 Sep 2021 16:54, Simon Marchi wrote:
> >> On 2021-06-13 1:25 a.m., Mike Frysinger via Gdb-patches wrote:
> >>> A few sims use this to emulate process syscalls.
> >>>  gnulib/Makefile.in               |   4 +
> >>>  gnulib/aclocal.m4                |   1 +
> >>>  gnulib/config.in                 |   3 +
> >>>  gnulib/configure                 |  99 +++++++++++++++++++++++
> >>>  gnulib/import/Makefile.am        |  29 +++++++
> >>>  gnulib/import/Makefile.in        |  35 +++++++--
> >>>  gnulib/import/m4/gnulib-cache.m4 |   2 +
> >>>  gnulib/import/m4/gnulib-comp.m4  |   5 ++
> >>>  gnulib/import/m4/sys_wait_h.m4   |  36 +++++++++
> >>>  gnulib/import/sys_wait.in.h      | 131 +++++++++++++++++++++++++++++++
> >>>  gnulib/update-gnulib.sh          |   1 +
> >>>  11 files changed, 340 insertions(+), 6 deletions(-)
> >>>  create mode 100644 gnulib/import/m4/sys_wait_h.m4
> >>>  create mode 100644 gnulib/import/sys_wait.in.h
> >>
> >> I don't really know how to assess the risks of merging this, how things
> >> could go wrong.  But intuitively I think it should be relatively safe.
> >> I'd say go ahead and merge it.
> > 
> > i feel like this could be a review for every patch ;)
> 
> Haha, indeed, that would make life easier.
> 
> I meant that maybe somebody knows that we don't want to import a
> particular module for some particular reason, a bit like what Eli said.
> There might be some instances of this, but if so they should be
> documented in gnulib/README, because there's no way to guess otherwise.

there's no existing notes like that in gnulib/README that i can see.  how
about updating gnulib/update-gnulib.sh to list dependencies for each module
that is listed there ?  that'd solve the issue of the two files falling out
of sync.

or we could delete the hardcoded IMPORTED_GNULIB_MODULES and have it be
calculated from the gnulib/README contents ... that would force the docs to
stay up-to-date.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-09-08  0:55       ` Mike Frysinger
@ 2021-09-08 14:41         ` Simon Marchi
  2021-09-08 20:20           ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Simon Marchi @ 2021-09-08 14:41 UTC (permalink / raw)
  To: gdb-patches

> there's no existing notes like that in gnulib/README that i can see.  how
> about updating gnulib/update-gnulib.sh to list dependencies for each module
> that is listed there ?  that'd solve the issue of the two files falling out
> of sync.

I don't follow you.  I was just saying that sometimes, there are reasons
why we don't want to import a given gnulib module, because it doesn't
work for us.  Like, there was an issue with stat, I don't remember the
details exactly.  If that happens, it would be good to have a note
somewhere explaining it.

Simon

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnulib: import sys_wait
  2021-09-08 14:41         ` Simon Marchi
@ 2021-09-08 20:20           ` Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2021-09-08 20:20 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On 08 Sep 2021 10:41, Simon Marchi via Gdb-patches wrote:
> > there's no existing notes like that in gnulib/README that i can see.  how
> > about updating gnulib/update-gnulib.sh to list dependencies for each module
> > that is listed there ?  that'd solve the issue of the two files falling out
> > of sync.
> 
> I don't follow you.  I was just saying that sometimes, there are reasons
> why we don't want to import a given gnulib module, because it doesn't
> work for us.  Like, there was an issue with stat, I don't remember the
> details exactly.  If that happens, it would be good to have a note
> somewhere explaining it.

sorry, i thought you wanted to document modules that were imported, not ones
that we were explicitly omitting.  i'm not familiar with the history of the
stat module here to help.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-09-08 20:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13  5:25 [PATCH] gnulib: import sys_wait Mike Frysinger
2021-06-14 12:18 ` Eli Zaretskii
2021-06-14 14:35   ` Mike Frysinger
2021-06-14 14:43     ` Eli Zaretskii
2021-06-14 19:35       ` Mike Frysinger
2021-06-30  7:03 ` Mike Frysinger
2021-08-18 16:19   ` Mike Frysinger
2021-09-04  1:15     ` Mike Frysinger
2021-09-03 20:54 ` Simon Marchi
2021-09-04  7:41   ` Mike Frysinger
2021-09-07 14:51     ` Simon Marchi
2021-09-08  0:55       ` Mike Frysinger
2021-09-08 14:41         ` Simon Marchi
2021-09-08 20:20           ` Mike Frysinger

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).