From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yTwtFMNQzmoCoQIAWB0awg (envelope-from ) for ; Tue, 13 Oct 2026 11:39:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 3DDFF1E051; Tue, 13 Oct 2026 11:39:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7B3AF1E04E for ; Tue, 13 Oct 2026 11:39:45 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9716C4BA23F8 for ; Tue, 13 Oct 2026 15:39:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9716C4BA23F8 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E104A4BA23F8 for ; Tue, 13 Oct 2026 15:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E104A4BA23F8 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E104A4BA23F8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791905951; cv=none; b=ctHbonjIfzkPqcoQPNTQAMMV7kwzidCw6v8CKVvz1hoF7Jh/cFFDiPw4L4CJDROPRvWD+CpJ3w7xPTAkd+8o3XQwgNp6q2N4NwIbOdzT6ZgK2AnqSgHWfOztqS6JssbkZ/TjQj3Ft7eCQwun7CMXZnQqWaZyQ7Qoazc7Cr9mFH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791905951; c=relaxed/simple; bh=rCvx4D7fqlcielnHl7TzRaoFwr6X2gVi+VvYTaa8IO8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vJo8aQj7rSE5zsT5ceCbPXyEf6O0jSbZxjS0R0VTsXmdTUX/d2cgKla0R5Ee5F2BZPH5fqMamlzWhj0ZMj43tnDs9pjuXk0h9NI83Cbzdl4NIXJhuDL+QSGjXmG6cfvfNloogSrt3yFup1rjl7rC33QoVt4IWmFjclW39f7QHn8= ARC-Authentication-Results: i=1; sourceware.org Received: by simark.ca (Postfix) id 117B21E051; Tue, 13 Oct 2026 11:39:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 10/16] gdb, gdbserver: remove configure checks already done by GDB_AC_COMMON Date: Tue, 13 Oct 2026 11:35:56 -0400 Message-ID: <20261013153657.1610298-11-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013153657.1610298-1-simon.marchi@efficios.com> References: <20261013153657.1610298-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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 -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 -#ifdef HAVE_VFORK_H -# include -#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 , but some compilers - (e.g. gcc -O) don't grok . 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