From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 10/16] gdb, gdbserver: remove configure checks already done by GDB_AC_COMMON
Date: Tue, 13 Oct 2026 11:35:56 -0400 [thread overview]
Message-ID: <20261013153657.1610298-11-simon.marchi@efficios.com> (raw)
In-Reply-To: <20261013153657.1610298-1-simon.marchi@efficios.com>
GDB_AC_COMMON, in gdbsupport/common.m4, already performs these checks,
so doing them again in the configure.ac files is redundant:
- in gdb: sys/resource.h, sys/socket.h, termios.h, thread_db.h,
getrlimit and AM_LANGINFO_CODESET
- in gdbserver: linux/elf.h, sys/socket.h, termios.h and
AC_FUNC_FORK
Remove them.
Regenerate configure in gdb and gdbserver.
Change-Id: I3ef2b19129a3ca5758d696447c5479255aadb175
---
gdb/configure | 51 ----------
gdb/configure.ac | 7 --
gdbserver/configure | 216 -----------------------------------------
gdbserver/configure.ac | 4 -
4 files changed, 278 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index a64e382fa377..21168d43b68b 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -29158,9 +29158,6 @@ for ac_header in \
sys/procctl.h \
sys/ptrace.h \
sys/reg.h \
- sys/resource.h \
- termios.h \
- thread_db.h \
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -29230,18 +29227,6 @@ fi
done
-for ac_header in sys/socket.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_socket_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_SOCKET_H 1
-_ACEOF
-
-fi
-
-done
-
for ac_header in ws2tcpip.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
@@ -29869,7 +29854,6 @@ for ac_func in \
clearenv \
getgid \
getpgid \
- getrlimit \
getuid \
iconvlist \
init_extended_color \
@@ -29899,41 +29883,6 @@ fi
done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
-$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if ${am_cv_langinfo_codeset+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <langinfo.h>
-int
-main ()
-{
-char* cs = nl_langinfo(CODESET);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- am_cv_langinfo_codeset=yes
-else
- am_cv_langinfo_codeset=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
-$as_echo "$am_cv_langinfo_codeset" >&6; }
- if test $am_cv_langinfo_codeset = yes; then
-
-$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
-
- fi
-
-
# Check the return and argument types of ptrace.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 6545320b7b96..890e2f2849de 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1456,9 +1456,6 @@ AC_CHECK_HEADERS([ \
sys/procctl.h \
sys/ptrace.h \
sys/reg.h \
- sys/resource.h \
- termios.h \
- thread_db.h \
])
AC_CHECK_HEADERS(sys/user.h, [], [],
@@ -1482,7 +1479,6 @@ AC_CHECK_HEADERS(term.h, [], [],
#endif
])
-AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([ws2tcpip.h])
AC_CHECK_HEADERS([execinfo.h])
@@ -1525,7 +1521,6 @@ AC_CHECK_FUNCS([ \
clearenv \
getgid \
getpgid \
- getrlimit \
getuid \
iconvlist \
init_extended_color \
@@ -1544,8 +1539,6 @@ AC_CHECK_FUNCS([ \
wresize \
])
-AM_LANGINFO_CODESET
-
# Check the return and argument types of ptrace.
GDB_AC_PTRACE
diff --git a/gdbserver/configure b/gdbserver/configure
index 6cf97b7ab5d7..d695c6191e33 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -12547,7 +12547,6 @@ fi
for ac_header in \
arpa/inet.h \
fcntl.h \
- linux/elf.h \
netdb.h \
netinet/in.h \
netinet/tcp.h \
@@ -12556,8 +12555,6 @@ for ac_header in \
sys/ioctl.h \
sys/procfs.h \
sys/reg.h \
- sys/socket.h \
- termios.h \
ws2tcpip.h \
do :
@@ -12573,219 +12570,6 @@ fi
done
-for ac_header in vfork.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_VFORK_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_func in fork vfork
-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"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-if test "x$ac_cv_func_fork" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
-$as_echo_n "checking for working fork... " >&6; }
-if ${ac_cv_func_fork_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_fork_works=cross
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* By Ruediger Kuhlmann. */
- return fork () < 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_fork_works=yes
-else
- ac_cv_func_fork_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
-$as_echo "$ac_cv_func_fork_works" >&6; }
-
-else
- ac_cv_func_fork_works=$ac_cv_func_fork
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
- case $host in
- *-*-amigaos* | *-*-msdosdjgpp*)
- # Override, as these systems have only a dummy fork() stub
- ac_cv_func_fork_works=no
- ;;
- *)
- ac_cv_func_fork_works=yes
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
-$as_echo_n "checking for working vfork... " >&6; }
-if ${ac_cv_func_vfork_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_vfork_works=cross
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Thanks to Paul Eggert for this test. */
-$ac_includes_default
-#include <sys/wait.h>
-#ifdef HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent. The compiler
- is told about this with #include <vfork.h>, but some compilers
- (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
- static variable whose address is put into a register that is
- clobbered by the vfork. */
-static void
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
- static pid_t child;
- if (!child) {
- child = vfork ();
- if (child < 0) {
- perror ("vfork");
- _exit(2);
- }
- if (!child) {
- arg = getpid();
- write(-1, "", 0);
- _exit (arg);
- }
- }
-}
-
-int
-main ()
-{
- pid_t parent = getpid ();
- pid_t child;
-
- sparc_address_test (0);
-
- child = vfork ();
-
- if (child == 0) {
- /* Here is another test for sparc vfork register problems. This
- test uses lots of local variables, at least as many local
- variables as main has allocated so far including compiler
- temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
- 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
- reuse the register of parent for one of the local variables,
- since it will think that parent can't possibly be used any more
- in this routine. Assigning to the local variable will thus
- munge parent in the parent process. */
- pid_t
- p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
- p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
- /* Convince the compiler that p..p7 are live; otherwise, it might
- use the same hardware register for all 8 local variables. */
- if (p != p1 || p != p2 || p != p3 || p != p4
- || p != p5 || p != p6 || p != p7)
- _exit(1);
-
- /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
- from child file descriptors. If the child closes a descriptor
- before it execs or exits, this munges the parent's descriptor
- as well. Test for this by closing stdout in the child. */
- _exit(close(fileno(stdout)) != 0);
- } else {
- int status;
- struct stat st;
-
- while (wait(&status) != child)
- ;
- return (
- /* Was there some problem with vforking? */
- child < 0
-
- /* Did the child fail? (This shouldn't happen.) */
- || status
-
- /* Did the vfork/compiler bug occur? */
- || parent != getpid()
-
- /* Did the file descriptor bug occur? */
- || fstat(fileno(stdout), &st) != 0
- );
- }
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_vfork_works=yes
-else
- ac_cv_func_vfork_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
-$as_echo "$ac_cv_func_vfork_works" >&6; }
-
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
- ac_cv_func_vfork_works=$ac_cv_func_vfork
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
-fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
-
-$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
-
-else
-
-$as_echo "#define vfork fork" >>confdefs.h
-
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
-
-fi
-
for ac_func in \
pread \
pread64 \
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 217564716147..1f461fa05727 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -68,7 +68,6 @@ ZW_GNU_GETTEXT_SISTER_DIR
AC_CHECK_HEADERS([ \
arpa/inet.h \
fcntl.h \
- linux/elf.h \
netdb.h \
netinet/in.h \
netinet/tcp.h \
@@ -77,12 +76,9 @@ AC_CHECK_HEADERS([ \
sys/ioctl.h \
sys/procfs.h \
sys/reg.h \
- sys/socket.h \
- termios.h \
ws2tcpip.h \
])
-AC_FUNC_FORK
AC_CHECK_FUNCS([ \
pread \
pread64 \
--
2.56.0
next prev parent reply other threads:[~2026-10-13 15:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 15:35 [PATCH 00/16] Cleanup obsolete configure checks Simon Marchi
2026-10-13 15:35 ` [PATCH 01/16] gdb: don't check for sys/debugreg.h Simon Marchi
2026-10-13 15:35 ` [PATCH 02/16] gdb: don't check for sigsetmask and ttrace Simon Marchi
2026-10-13 15:35 ` [PATCH 03/16] gdbsupport: don't check for strstr declaration Simon Marchi
2026-10-13 15:35 ` [PATCH 04/16] gdbserver, gdbsupport: remove unneeded sys/procfs.h type checks Simon Marchi
2026-10-13 15:35 ` [PATCH 05/16] gdbserver: don't define HAVE_SYNC_BUILTINS Simon Marchi
2026-10-13 15:35 ` [PATCH 06/16] gdb: don't check for long double support Simon Marchi
2026-10-13 15:35 ` [PATCH 07/16] gdbserver: remove leftover Windows CE check in configure.ac Simon Marchi
2026-10-13 15:35 ` [PATCH 08/16] gdbsupport: don't check for memory.h Simon Marchi
2026-10-13 15:35 ` [PATCH 09/16] gdbserver: don't check for string.h Simon Marchi
2026-10-13 15:35 ` Simon Marchi [this message]
2026-10-13 15:35 ` [PATCH 11/16] gdb: remove redundant dlopen library search Simon Marchi
2026-10-13 15:35 ` [PATCH 12/16] gdb: don't check for long long support in the compiler Simon Marchi
2026-10-13 15:35 ` [PATCH 13/16] gdb: remove AC_C_CONST and AC_C_INLINE Simon Marchi
2026-10-13 15:36 ` [PATCH 14/16] gdbserver: remove fallback declarations of perror, vasprintf and vsnprintf Simon Marchi
2026-10-13 15:36 ` [PATCH 15/16] gdb: remove redundant snprintf declaration check Simon Marchi
2026-10-13 15:36 ` [PATCH 16/16] gdbserver, gdbsupport: don't check for signal.h, fcntl.h and locale.h Simon Marchi
2026-10-14 12:08 ` [PATCH 00/16] Cleanup obsolete configure checks Tom Tromey
2026-10-14 12:53 ` 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=20261013153657.1610298-11-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--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