From patchwork Mon Jan 16 09:46:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 63226 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F2773857C45 for ; Mon, 16 Jan 2023 09:47:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F2773857C45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673862446; bh=UzljwnFDzGS33Ufbjy4dD3qm0W+bVKQjHZdTFy9FeOE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AFXxFTXM7A69luyDLgsFyY5IX1+0HNijMANKCPuaqoQK0V7d27uBbL6iUSKqOaitv Wg0RKoCi81JQLkabjG5fDcqwYIATENKqA4Ua6ZjWpodd4Te1i2BaLmJFw4iHHCr3gJ KR6Pp9xCsVm3MSU40kHZTpD25dkQ85QVY6KwKsSk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 30E6E3858C31 for ; Mon, 16 Jan 2023 09:46:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30E6E3858C31 Received: by smtp.gentoo.org (Postfix, from userid 559) id CE86A335CDF; Mon, 16 Jan 2023 09:46:58 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 1/3] sim: build: stop probing system extensions (ourselves) Date: Mon, 16 Jan 2023 04:46:54 -0500 Message-Id: <20230116094656.22818-1-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This logic was added in order to expose the strsignal prototype for nrun.c. Since then, we've migrated to gnulib as our portability layer, and it takes care of probing system extensions for us, so there's no need to duplicate the work. --- sim/config.h.in | 32 -------- sim/configure | 159 +------------------------------------ sim/m4/sim_ac_toolchain.m4 | 1 - 3 files changed, 3 insertions(+), 189 deletions(-) diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4 index 50f08f90d5d7..cb145f78530e 100644 --- a/sim/m4/sim_ac_toolchain.m4 +++ b/sim/m4/sim_ac_toolchain.m4 @@ -17,7 +17,6 @@ dnl Setup the toolchain variables. AC_DEFUN([SIM_AC_TOOLCHAIN], [dnl AC_CANONICAL_SYSTEM -AC_USE_SYSTEM_EXTENSIONS AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) AC_C_BIGENDIAN From patchwork Mon Jan 16 09:46:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 63228 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C52E2385802F for ; Mon, 16 Jan 2023 09:47:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C52E2385802F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673862461; bh=LnkCGKokt/4HK72MuGBEozz1tTq/1reSVFXCX2rdArg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oSRq6snczXg+9E9gJp+zWzJbOJqYIqYgYNa9yG1sLFsBJU10siMAJW9sSnmheN7Gd sSsgE8XOj0v3xcFf6w9hR85lZi71YbI1t1hD8cTrATX0QSi/E8FTlb2x0YUQ1lnpyA snZNTaDQnkxniI212SFIkx6txiOmminv2M9FpNAE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 970DE3858C83 for ; Mon, 16 Jan 2023 09:47:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 970DE3858C83 Received: by smtp.gentoo.org (Postfix, from userid 559) id 055C8335D99; Mon, 16 Jan 2023 09:47:01 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 2/3] sim: formally assume unistd.h always exists (via gnulib) Date: Mon, 16 Jan 2023 04:46:55 -0500 Message-Id: <20230116094656.22818-2-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116094656.22818-1-vapier@gentoo.org> References: <20230116094656.22818-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK. --- sim/arm/armos.c | 3 --- sim/common/callback.c | 2 -- sim/common/dv-pal.c | 2 -- sim/common/dv-sockser.c | 2 -- sim/common/nrun.c | 2 -- sim/common/sim-io.c | 2 -- sim/common/sim-memopt.c | 2 -- sim/common/syscall.c | 2 -- sim/configure | 7 ++----- sim/cr16/simops.c | 2 -- sim/cris/dv-rv.c | 2 -- sim/cris/rvdummy.c | 3 --- sim/cris/traps.c | 2 -- sim/d10v/simops.c | 2 -- sim/m4/sim_ac_platform.m4 | 3 ++- sim/m68hc11/emulos.c | 2 -- sim/mn10300/op_utils.c | 2 -- sim/ppc/emul_bugapi.c | 2 -- sim/ppc/emul_chirp.c | 2 -- sim/ppc/emul_netbsd.c | 2 -- sim/ppc/emul_unix.c | 2 -- sim/ppc/hw_com.c | 2 -- sim/ppc/hw_disk.c | 3 --- sim/ppc/hw_pal.c | 2 -- sim/ppc/main.c | 2 -- sim/ppc/mon.c | 2 -- sim/ppc/table.c | 2 -- sim/rl78/main.c | 2 -- sim/rx/main.c | 2 -- sim/sh/interp.c | 2 -- sim/v850/simops.c | 2 -- 31 files changed, 4 insertions(+), 67 deletions(-) diff --git a/sim/arm/armos.c b/sim/arm/armos.c index a8ef7e4a82d9..9cf238ac8e25 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -31,10 +31,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H #include /* For SEEK_SET etc. */ -#endif #include "armdefs.h" #include "armos.h" diff --git a/sim/common/callback.c b/sim/common/callback.c index ff14a111b659..306e95e866da 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -34,9 +34,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/sim/common/dv-pal.c b/sim/common/dv-pal.c index 56692c1dcb84..25f8c683e29a 100644 --- a/sim/common/dv-pal.c +++ b/sim/common/dv-pal.c @@ -24,9 +24,7 @@ #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include "sim-main.h" #include "hw-main.h" diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index fba2775f2e87..698cab839209 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -29,9 +29,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 4c011627bb85..2ebf8a127166 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -21,10 +21,8 @@ along with this program. If not, see . */ #include /* For strsignal. */ #include -#ifdef HAVE_UNISTD_H /* For chdir. */ #include -#endif #include "bfd.h" #include "environ.h" diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c index f126c9622aea..fc0d42faf117 100644 --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -29,9 +29,7 @@ #include #include #include -#if HAVE_UNISTD_H #include -#endif #undef open diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 2d1b96b7889c..2e5016c52ab1 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -26,9 +26,7 @@ along with this program. If not, see . */ #endif #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_SYS_MMAN_H #include #endif diff --git a/sim/common/syscall.c b/sim/common/syscall.c index f65f616a2316..96033db84c3b 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -33,9 +33,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c index e652b8153f80..73420a7e0c6c 100644 --- a/sim/cr16/simops.c +++ b/sim/cr16/simops.c @@ -24,9 +24,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/cris/dv-rv.c b/sim/cris/dv-rv.c index 6caa4dd34438..9142b88f7d7f 100644 --- a/sim/cris/dv-rv.c +++ b/sim/cris/dv-rv.c @@ -29,9 +29,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/sim/cris/rvdummy.c b/sim/cris/rvdummy.c index a263ee3c0ffd..91a7ddc8a8d5 100644 --- a/sim/cris/rvdummy.c +++ b/sim/cris/rvdummy.c @@ -36,10 +36,7 @@ main (int argc, char *argv[]) #include "libiberty.h" #include - -#ifdef HAVE_UNISTD_H #include -#endif #include #include #ifdef HAVE_SYS_TYPES_H diff --git a/sim/cris/traps.c b/sim/cris/traps.c index afcb3480840c..f5f169f1c81f 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -32,9 +32,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_FCNTL_H #include #endif diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c index 96ed29f6abe1..bc7806cc278a 100644 --- a/sim/d10v/simops.c +++ b/sim/d10v/simops.c @@ -5,9 +5,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include "bfd.h" diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4 index 6356a80e16ff..665c1bd7866c 100644 --- a/sim/m4/sim_ac_platform.m4 +++ b/sim/m4/sim_ac_platform.m4 @@ -18,12 +18,12 @@ AC_DEFUN([SIM_AC_PLATFORM], [dnl dnl Check for common headers. dnl NB: You can assume C11 headers exist. +dnl NB: We use gnulib from ../gnulib/, so we don't probe headers it provides. AC_CHECK_HEADERS_ONCE(m4_flatten([ dlfcn.h fcntl.h fpu_control.h termios.h - unistd.h utime.h linux/if_tun.h linux/mii.h @@ -46,6 +46,7 @@ AC_CHECK_HEADERS_ONCE(m4_flatten([ ])) AC_HEADER_DIRENT +dnl NB: We use gnulib from ../gnulib/, so we don't probe functions it provides. AC_CHECK_FUNCS_ONCE(m4_flatten([ __setfpucw access diff --git a/sim/m68hc11/emulos.c b/sim/m68hc11/emulos.c index 50d275346347..fcf9cc1b5e57 100644 --- a/sim/m68hc11/emulos.c +++ b/sim/m68hc11/emulos.c @@ -21,9 +21,7 @@ along with this program. If not, see . */ #include "defs.h" #include "sim-main.h" -#ifdef HAVE_UNISTD_H #include -#endif #include "m68hc11-sim.h" diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c index b29b803d8e7f..7e035f432590 100644 --- a/sim/mn10300/op_utils.c +++ b/sim/mn10300/op_utils.c @@ -3,9 +3,7 @@ #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/ppc/emul_bugapi.c b/sim/ppc/emul_bugapi.c index f4eed443d8bd..067e40691e2f 100644 --- a/sim/ppc/emul_bugapi.c +++ b/sim/ppc/emul_bugapi.c @@ -27,9 +27,7 @@ #include "emul_generic.h" #include "emul_bugapi.h" -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/sim/ppc/emul_chirp.c b/sim/ppc/emul_chirp.c index 116f3732ac74..c064a28a7c62 100644 --- a/sim/ppc/emul_chirp.c +++ b/sim/ppc/emul_chirp.c @@ -28,9 +28,7 @@ #include "emul_chirp.h" #include -#ifdef HAVE_UNISTD_H #include -#endif #ifndef STATIC_INLINE_EMUL_CHIRP #define STATIC_INLINE_EMUL_CHIRP STATIC_INLINE diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index a8bfd27610e2..51f8e98ae32b 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -72,10 +72,8 @@ int getrusage(); # endif #endif -#ifdef HAVE_UNISTD_H #undef MAXPATHLEN /* sys/param.h might define this also */ #include -#endif #include diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index 1d8b7814ffc6..2872d236bf36 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -115,10 +115,8 @@ int getrusage(); # endif #endif -#ifdef HAVE_UNISTD_H #undef MAXPATHLEN /* sys/param.h might define this also */ #include -#endif #include #include diff --git a/sim/ppc/hw_com.c b/sim/ppc/hw_com.c index 4ffd73203f49..768d1ca6a3c5 100644 --- a/sim/ppc/hw_com.c +++ b/sim/ppc/hw_com.c @@ -28,9 +28,7 @@ #include "device_table.h" #include -#ifdef HAVE_UNISTD_H #include -#endif #include /* DEVICE diff --git a/sim/ppc/hw_disk.c b/sim/ppc/hw_disk.c index 3a825202784d..54a11f628273 100644 --- a/sim/ppc/hw_disk.c +++ b/sim/ppc/hw_disk.c @@ -26,10 +26,7 @@ #include "pk.h" #include - -#ifdef HAVE_UNISTD_H #include -#endif #ifndef SEEK_SET #define SEEK_SET 0 diff --git a/sim/ppc/hw_pal.c b/sim/ppc/hw_pal.c index 8b0770993699..f8585084b371 100644 --- a/sim/ppc/hw_pal.c +++ b/sim/ppc/hw_pal.c @@ -30,9 +30,7 @@ #include "cpu.h" #include -#ifdef HAVE_UNISTD_H #include -#endif #include diff --git a/sim/ppc/main.c b/sim/ppc/main.c index 83b629ec14aa..aa1c85e0af91 100644 --- a/sim/ppc/main.c +++ b/sim/ppc/main.c @@ -36,9 +36,7 @@ #include "sim/sim.h" #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 4e29ec998798..8ab42af84589 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -26,9 +26,7 @@ #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/sim/ppc/table.c b/sim/ppc/table.c index 6399bdaddcb1..da1696759587 100644 --- a/sim/ppc/table.c +++ b/sim/ppc/table.c @@ -29,9 +29,7 @@ #include "lf.h" #include "table.h" -#ifdef HAVE_UNISTD_H #include -#endif #include typedef struct _open_table open_table; diff --git a/sim/rl78/main.c b/sim/rl78/main.c index 7c250f7172c1..1eafa3392eaf 100644 --- a/sim/rl78/main.c +++ b/sim/rl78/main.c @@ -25,9 +25,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/rx/main.c b/sim/rx/main.c index e404446dd700..13d0c473e743 100644 --- a/sim/rx/main.c +++ b/sim/rx/main.c @@ -24,9 +24,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 5a90cd2cf74c..5e0e8c47569f 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -25,9 +25,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_MMAP #include # ifndef MAP_FAILED diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 69db8aaaa53d..326745efcb26 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -12,9 +12,7 @@ #include #endif #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include From patchwork Mon Jan 16 09:46:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 63227 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28603385703A for ; Mon, 16 Jan 2023 09:47:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28603385703A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673862454; bh=iazrkInq9SwufrhAJ/KcHn5Q/0/dxOAw/lmNuNtORrc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=STPHZRsNBelPrIEHEk4sdosBsjh4itFmDWczudDm2OdnRkHdIO6EVGVYfuEpGM8qL pvhSoZMvgCzqzmILQS+oWVfdxu/1antkZ4BO/mO5aBZUJY5W66boW+F5Ho1UbPvs0S NUOWfUxUdcczPE0b/EJEHcrkDkLSGJZBuBKrBc40= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 7A1033858430 for ; Mon, 16 Jan 2023 09:47:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A1033858430 Received: by smtp.gentoo.org (Postfix, from userid 559) id 16352335D99; Mon, 16 Jan 2023 09:47:04 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 3/3] sim: assume sys/stat.h always exists (via gnulib) Date: Mon, 16 Jan 2023 04:46:56 -0500 Message-Id: <20230116094656.22818-3-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116094656.22818-1-vapier@gentoo.org> References: <20230116094656.22818-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" We have many uses of sys/stat.h that are unprotected by HAVE_SYS_STAT_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a sys/stat.h exists for us to include, so we're doubly OK. --- sim/common/sim-memopt.c | 2 -- sim/configure | 33 ++------------------------------- sim/cris/traps.c | 2 -- sim/h8300/compile.c | 2 +- sim/m4/sim_ac_platform.m4 | 5 +---- sim/ppc/emul_unix.c | 4 ---- sim/sh/interp.c | 2 -- 7 files changed, 4 insertions(+), 46 deletions(-) diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 2e5016c52ab1..7d46a864afc5 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -30,9 +30,7 @@ along with this program. If not, see . */ #ifdef HAVE_SYS_MMAN_H #include #endif -#ifdef HAVE_SYS_STAT_H #include -#endif #include "sim-main.h" #include "sim-assert.h" diff --git a/sim/cris/traps.c b/sim/cris/traps.c index f5f169f1c81f..29b1b7cfdb38 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -39,9 +39,7 @@ along with this program. If not, see . */ #ifdef HAVE_SYS_PARAM_H #include #endif -#ifdef HAVE_SYS_STAT_H #include -#endif /* For PATH_MAX, originally. */ #ifdef HAVE_LIMITS_H #include diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 467eeafde610..1e303a92eca1 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -26,11 +26,11 @@ #ifdef HAVE_SYS_PARAM_H #include #endif +#include #include "bfd.h" #include "sim-main.h" #include "sim/sim-h8300.h" -#include "sys/stat.h" #include "sys/types.h" #include "sim-options.h" #include "sim-signal.h" diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4 index 665c1bd7866c..7331ef3a38c5 100644 --- a/sim/m4/sim_ac_platform.m4 +++ b/sim/m4/sim_ac_platform.m4 @@ -37,7 +37,6 @@ AC_CHECK_HEADERS_ONCE(m4_flatten([ sys/param.h sys/resource.h sys/socket.h - sys/stat.h sys/statfs.h sys/termio.h sys/termios.h @@ -126,9 +125,7 @@ AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino], [[#ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_STAT_H -#include -#endif]]) +#include ]]) AC_CHECK_TYPES([__int128]) AC_CHECK_TYPES(socklen_t, [], [], diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index 2872d236bf36..be9e8385f526 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -1055,7 +1055,6 @@ typedef uint32_t solaris_ino_t; typedef uint32_t solaris_mode_t; typedef uint32_t solaris_nlink_t; -#ifdef HAVE_SYS_STAT_H #define SOLARIS_ST_FSTYPSZ 16 /* array size for file system type name */ /* AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively */ @@ -1145,7 +1144,6 @@ convert_to_solaris_stat(unsigned_word addr, emul_write_buffer(&target, addr, sizeof(target), processor, cia); } -#endif /* HAVE_SYS_STAT_H */ #ifndef HAVE_STAT #define do_solaris_stat 0 @@ -2011,7 +2009,6 @@ typedef int32_t linux_time_t; typedef int32_t linux_clock_t; typedef int32_t linux_daddr_t; -#ifdef HAVE_SYS_STAT_H /* For the PowerPC, don't both with the 'old' stat structure, since there should be no extant binaries with that structure. */ @@ -2082,7 +2079,6 @@ convert_to_linux_stat(unsigned_word addr, emul_write_buffer(&target, addr, sizeof(target), processor, cia); } -#endif /* HAVE_SYS_STAT_H */ #ifndef HAVE_STAT #define do_linux_stat 0 diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 5e0e8c47569f..c067f0f2bea6 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -38,9 +38,7 @@ #include #include -#ifdef HAVE_SYS_STAT_H #include -#endif #include #include #ifdef HAVE_UTIME_H