Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 16/16] gdbserver, gdbsupport: don't check for signal.h, fcntl.h and locale.h
Date: Tue, 13 Oct 2026 11:36:02 -0400	[thread overview]
Message-ID: <20261013153657.1610298-17-simon.marchi@efficios.com> (raw)
In-Reply-To: <20261013153657.1610298-1-simon.marchi@efficios.com>

These headers are already included unconditionally in files built on
all hosts: signal.h in gdb/utils.c, fcntl.h in gdb/defs.h and locale.h
in gnulib/import/hard-locale.c.  This shows that the checks are not
necessary.

Remove the HAVE_SIGNAL_H, HAVE_FCNTL_H and HAVE_LOCALE_H conditions
around their includes, and the corresponding header checks from
common.m4 and gdbserver's configure.ac.

Regenerate config.in and configure in gdb, gdbserver and gdbsupport.

Change-Id: I0b2953f3c9d2a13dc9cec37c683986b36edbecf4
---
 gdb/config.in             | 6 ------
 gdb/configure             | 2 --
 gdbserver/config.in       | 9 ---------
 gdbserver/configure       | 4 ----
 gdbserver/configure.ac    | 2 --
 gdbserver/fork-child.cc   | 2 --
 gdbserver/gdbreplay.cc    | 2 --
 gdbserver/remote-utils.cc | 4 ----
 gdbserver/server.cc       | 2 --
 gdbsupport/common.m4      | 2 --
 gdbsupport/config.in      | 6 ------
 gdbsupport/configure      | 2 --
 gdbsupport/gdb_locale.h   | 4 +---
 gdbsupport/signals.cc     | 2 --
 14 files changed, 1 insertion(+), 48 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index 9cfa1026d08f..7ea0e9cfce8e 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -303,9 +303,6 @@
 /* Define to 1 if you have the <linux/perf_event.h> header file. */
 #undef HAVE_LINUX_PERF_EVENT_H
 
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
 /* Define to 1 if the system has the type `long long'. */
 #undef HAVE_LONG_LONG
 
@@ -429,9 +426,6 @@
 /* Define to 1 if you have the `sigaltstack' function. */
 #undef HAVE_SIGALTSTACK
 
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
 /* Define to 1 if you have the `sigprocmask' function. */
 #undef HAVE_SIGPROCMASK
 
diff --git a/gdb/configure b/gdb/configure
index cfe994c3842a..b6222402d6c0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -19837,10 +19837,8 @@ for ac_header in  \
   dlfcn.h \
   linux/elf.h \
   linux/perf_event.h  \
-  locale.h \
   poll.h \
   proc_service.h \
-  signal.h \
   sys/poll.h \
   sys/resource.h \
   sys/select.h \
diff --git a/gdbserver/config.in b/gdbserver/config.in
index 7aae2f7398b5..cf6ebe0a4f26 100644
--- a/gdbserver/config.in
+++ b/gdbserver/config.in
@@ -105,9 +105,6 @@
 /* Define if <sys/procfs.h> has elf_fpregset_t. */
 #undef HAVE_ELF_FPREGSET_T
 
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
 /* Define to 1 if you have the `fdwalk' function. */
 #undef HAVE_FDWALK
 
@@ -165,9 +162,6 @@
 /* Define if the target supports PTRACE_PEEKUSR for register access. */
 #undef HAVE_LINUX_USRREGS
 
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
 /* Define to 1 if the system has the type `long long'. */
 #undef HAVE_LONG_LONG
 
@@ -253,9 +247,6 @@
 /* Define to 1 if you have the `sigaltstack' function. */
 #undef HAVE_SIGALTSTACK
 
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
 /* Define to 1 if you have the `sigprocmask' function. */
 #undef HAVE_SIGPROCMASK
 
diff --git a/gdbserver/configure b/gdbserver/configure
index 9555b15bd725..f838f0881201 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -8041,10 +8041,8 @@ for ac_header in  \
   dlfcn.h \
   linux/elf.h \
   linux/perf_event.h  \
-  locale.h \
   poll.h \
   proc_service.h \
-  signal.h \
   sys/poll.h \
   sys/resource.h \
   sys/select.h \
@@ -12546,11 +12544,9 @@ fi
 
 for ac_header in  \
   arpa/inet.h \
-  fcntl.h \
   netdb.h \
   netinet/in.h \
   netinet/tcp.h \
-  signal.h \
   sys/file.h \
   sys/ioctl.h \
   sys/procfs.h \
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 2ae3e1c6e494..16a2520baf42 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -67,11 +67,9 @@ ZW_GNU_GETTEXT_SISTER_DIR
 
 AC_CHECK_HEADERS([ \
   arpa/inet.h \
-  fcntl.h \
   netdb.h \
   netinet/in.h \
   netinet/tcp.h \
-  signal.h \
   sys/file.h \
   sys/ioctl.h \
   sys/procfs.h \
diff --git a/gdbserver/fork-child.cc b/gdbserver/fork-child.cc
index 7f57ea424375..055f772ec822 100644
--- a/gdbserver/fork-child.cc
+++ b/gdbserver/fork-child.cc
@@ -19,9 +19,7 @@
 #include "gdbsupport/job-control.h"
 #include "gdbsupport/scoped_restore.h"
 #include "nat/fork-inferior.h"
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #ifdef SIGTTOU
 /* A file descriptor for the controlling terminal.  */
diff --git a/gdbserver/gdbreplay.cc b/gdbserver/gdbreplay.cc
index f4626ceadb82..3a09a4d0f0c5 100644
--- a/gdbserver/gdbreplay.cc
+++ b/gdbserver/gdbreplay.cc
@@ -29,9 +29,7 @@
 #if HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include <unistd.h>
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index ff71eb674829..8192e4577f2e 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -51,12 +51,8 @@
 #if HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
-#if HAVE_FCNTL_H
 #include <fcntl.h>
-#endif
 #include "gdbsupport/gdb_sys_time.h"
 #include <unistd.h>
 #if HAVE_ARPA_INET_H
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index a208e24d09f6..74774fcde7ca 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -23,9 +23,7 @@
 #include "gdbsupport/rsp-low.h"
 #include "gdbsupport/signals-state-save-restore.h"
 #include <unistd.h>
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include "gdbsupport/gdb_vecs.h"
 #include "gdbsupport/gdb_wait.h"
 #include "gdbsupport/btrace-common.h"
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index 2f4b67127434..bf21c31d78d7 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -43,10 +43,8 @@ AC_CHECK_HEADERS([ \
   dlfcn.h \
   linux/elf.h \
   linux/perf_event.h  \
-  locale.h \
   poll.h \
   proc_service.h \
-  signal.h \
   sys/poll.h \
   sys/resource.h \
   sys/select.h \
diff --git a/gdbsupport/config.in b/gdbsupport/config.in
index f99a88352196..ff84ab0d6007 100644
--- a/gdbsupport/config.in
+++ b/gdbsupport/config.in
@@ -141,9 +141,6 @@
 /* Define to 1 if you have the <linux/perf_event.h> header file. */
 #undef HAVE_LINUX_PERF_EVENT_H
 
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
 /* Define to 1 if the system has the type `long long'. */
 #undef HAVE_LONG_LONG
 
@@ -204,9 +201,6 @@
 /* Define to 1 if you have the `sigaltstack' function. */
 #undef HAVE_SIGALTSTACK
 
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
 /* Define to 1 if you have the `sigprocmask' function. */
 #undef HAVE_SIGPROCMASK
 
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 5df02c4676fd..74861f27bfdc 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10940,10 +10940,8 @@ for ac_header in  \
   dlfcn.h \
   linux/elf.h \
   linux/perf_event.h  \
-  locale.h \
   poll.h \
   proc_service.h \
-  signal.h \
   sys/poll.h \
   sys/resource.h \
   sys/select.h \
diff --git a/gdbsupport/gdb_locale.h b/gdbsupport/gdb_locale.h
index f5f0f5622770..784552e670fc 100644
--- a/gdbsupport/gdb_locale.h
+++ b/gdbsupport/gdb_locale.h
@@ -19,9 +19,7 @@
 #ifndef GDBSUPPORT_GDB_LOCALE_H
 #define GDBSUPPORT_GDB_LOCALE_H
 
-#ifdef HAVE_LOCALE_H
-# include <locale.h>
-#endif
+#include <locale.h>
 
 #ifdef ENABLE_NLS
 # include <libintl.h>
diff --git a/gdbsupport/signals.cc b/gdbsupport/signals.cc
index 367ca571f3db..6f871c28c9e3 100644
--- a/gdbsupport/signals.cc
+++ b/gdbsupport/signals.cc
@@ -18,9 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #include "gdb_signals.h"
 
-- 
2.56.0


  parent reply	other threads:[~2026-10-13 15:41 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 ` [PATCH 10/16] gdb, gdbserver: remove configure checks already done by GDB_AC_COMMON Simon Marchi
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 ` Simon Marchi [this message]
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-17-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