summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-01 18:05:23 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-16 22:38:41 -0400
commit6df01ab8ab8509b04f86d7da069ec2d25eb31bf9 (patch)
tree21a00924bc74b7d5ec239a133d223f9d52f1dd67
parent681eb80f1217f66c83dec4a3db83577a2a09f74a (diff)
sim: switch config.h usage to defs.h
The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise.
-rw-r--r--sim/aarch64/ChangeLog7
-rw-r--r--sim/aarch64/cpustate.c3
-rw-r--r--sim/aarch64/cpustate.h1
-rw-r--r--sim/aarch64/interp.c4
-rw-r--r--sim/aarch64/memory.c4
-rw-r--r--sim/aarch64/simulator.c4
-rw-r--r--sim/aarch64/simulator.h1
-rw-r--r--sim/arm/ChangeLog7
-rw-r--r--sim/arm/armcopro.c3
-rw-r--r--sim/arm/armdefs.h1
-rw-r--r--sim/arm/armemu.c3
-rw-r--r--sim/arm/arminit.c3
-rw-r--r--sim/arm/armos.c4
-rw-r--r--sim/arm/armsupp.c3
-rw-r--r--sim/arm/armvirt.c3
-rw-r--r--sim/arm/iwmmxt.c3
-rw-r--r--sim/arm/maverick.c3
-rw-r--r--sim/arm/thumbemu.c3
-rw-r--r--sim/arm/wrapper.c4
-rw-r--r--sim/avr/ChangeLog4
-rw-r--r--sim/avr/interp.c3
-rw-r--r--sim/bfin/ChangeLog13
-rw-r--r--sim/bfin/bfin-sim.c3
-rw-r--r--sim/bfin/devices.c3
-rw-r--r--sim/bfin/dv-bfin_cec.c3
-rw-r--r--sim/bfin/dv-bfin_ctimer.c3
-rw-r--r--sim/bfin/dv-bfin_dma.c3
-rw-r--r--sim/bfin/dv-bfin_dmac.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_amc.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_ddrc.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_sdc.c3
-rw-r--r--sim/bfin/dv-bfin_emac.c3
-rw-r--r--sim/bfin/dv-bfin_eppi.c3
-rw-r--r--sim/bfin/dv-bfin_evt.c3
-rw-r--r--sim/bfin/dv-bfin_gpio.c3
-rw-r--r--sim/bfin/dv-bfin_gpio2.c3
-rw-r--r--sim/bfin/dv-bfin_gptimer.c3
-rw-r--r--sim/bfin/dv-bfin_jtag.c3
-rw-r--r--sim/bfin/dv-bfin_mmu.c3
-rw-r--r--sim/bfin/dv-bfin_nfc.c3
-rw-r--r--sim/bfin/dv-bfin_otp.c3
-rw-r--r--sim/bfin/dv-bfin_pfmon.c3
-rw-r--r--sim/bfin/dv-bfin_pint.c3
-rw-r--r--sim/bfin/dv-bfin_pll.c3
-rw-r--r--sim/bfin/dv-bfin_ppi.c3
-rw-r--r--sim/bfin/dv-bfin_rtc.c3
-rw-r--r--sim/bfin/dv-bfin_sic.c3
-rw-r--r--sim/bfin/dv-bfin_spi.c3
-rw-r--r--sim/bfin/dv-bfin_trace.c3
-rw-r--r--sim/bfin/dv-bfin_twi.c3
-rw-r--r--sim/bfin/dv-bfin_uart.c3
-rw-r--r--sim/bfin/dv-bfin_uart2.c3
-rw-r--r--sim/bfin/dv-bfin_wdog.c3
-rw-r--r--sim/bfin/dv-bfin_wp.c3
-rw-r--r--sim/bfin/dv-eth_phy.c3
-rw-r--r--sim/bfin/gui.c3
-rw-r--r--sim/bfin/interp.c3
-rw-r--r--sim/bfin/machs.c3
-rw-r--r--sim/bpf/ChangeLog4
-rw-r--r--sim/bpf/bpf-helpers.c3
-rw-r--r--sim/bpf/bpf.c3
-rw-r--r--sim/bpf/sim-if.c3
-rw-r--r--sim/bpf/traps.c3
-rw-r--r--sim/common/ChangeLog21
-rw-r--r--sim/common/callback.c6
-rw-r--r--sim/common/cgen-accfp.c3
-rw-r--r--sim/common/cgen-fpu.c3
-rw-r--r--sim/common/cgen-par.c3
-rw-r--r--sim/common/cgen-run.c3
-rw-r--r--sim/common/cgen-scache.c3
-rw-r--r--sim/common/cgen-trace.c4
-rw-r--r--sim/common/cgen-utils.c4
-rw-r--r--sim/common/defs.h30
-rw-r--r--sim/common/dv-cfi.c3
-rw-r--r--sim/common/dv-core.c2
-rw-r--r--sim/common/dv-glue.c2
-rw-r--r--sim/common/dv-pal.c4
-rw-r--r--sim/common/dv-sockser.c4
-rwxr-xr-xsim/common/genmloop.sh3
-rw-r--r--sim/common/gentmap.c2
-rw-r--r--sim/common/hw-alloc.c2
-rw-r--r--sim/common/hw-base.c2
-rw-r--r--sim/common/hw-device.c2
-rw-r--r--sim/common/hw-events.c2
-rw-r--r--sim/common/hw-handles.c2
-rw-r--r--sim/common/hw-instances.c2
-rw-r--r--sim/common/hw-ports.c2
-rw-r--r--sim/common/hw-properties.c3
-rw-r--r--sim/common/hw-tree.c2
-rw-r--r--sim/common/nrun.c4
-rw-r--r--sim/common/sim-abort.c3
-rw-r--r--sim/common/sim-arange.c3
-rw-r--r--sim/common/sim-basics.h4
-rw-r--r--sim/common/sim-bits.c3
-rw-r--r--sim/common/sim-close.c3
-rw-r--r--sim/common/sim-command.c3
-rw-r--r--sim/common/sim-config.c2
-rw-r--r--sim/common/sim-core.c3
-rw-r--r--sim/common/sim-cpu.c3
-rw-r--r--sim/common/sim-endian.c3
-rw-r--r--sim/common/sim-engine.c3
-rw-r--r--sim/common/sim-events.c3
-rw-r--r--sim/common/sim-fpu.c3
-rw-r--r--sim/common/sim-hload.c3
-rw-r--r--sim/common/sim-hrw.c3
-rw-r--r--sim/common/sim-hw.c3
-rw-r--r--sim/common/sim-info.c3
-rw-r--r--sim/common/sim-inline.c3
-rw-r--r--sim/common/sim-io.c4
-rw-r--r--sim/common/sim-load.c6
-rw-r--r--sim/common/sim-memopt.c3
-rw-r--r--sim/common/sim-model.c3
-rw-r--r--sim/common/sim-module.c4
-rw-r--r--sim/common/sim-options.c4
-rw-r--r--sim/common/sim-profile.c3
-rw-r--r--sim/common/sim-reason.c3
-rw-r--r--sim/common/sim-reg.c3
-rw-r--r--sim/common/sim-resume.c3
-rw-r--r--sim/common/sim-run.c3
-rw-r--r--sim/common/sim-signal.c3
-rw-r--r--sim/common/sim-stop.c3
-rw-r--r--sim/common/sim-syscall.c3
-rw-r--r--sim/common/sim-trace.c3
-rw-r--r--sim/common/sim-utils.c3
-rw-r--r--sim/common/sim-watch.c4
-rw-r--r--sim/common/syscall.c6
-rw-r--r--sim/cr16/ChangeLog9
-rw-r--r--sim/cr16/cr16_sim.h1
-rw-r--r--sim/cr16/gencode.c5
-rw-r--r--sim/cr16/interp.c4
-rw-r--r--sim/cr16/simops.c4
-rw-r--r--sim/cris/ChangeLog6
-rw-r--r--sim/cris/cris-tmpl.c3
-rw-r--r--sim/cris/crisv10f.c3
-rw-r--r--sim/cris/crisv32f.c3
-rw-r--r--sim/cris/dv-cris.c3
-rw-r--r--sim/cris/dv-cris_900000xx.c3
-rw-r--r--sim/cris/dv-rv.c2
-rw-r--r--sim/cris/rvdummy.c5
-rw-r--r--sim/cris/sim-if.c4
-rw-r--r--sim/cris/traps.c3
-rw-r--r--sim/d10v/ChangeLog6
-rw-r--r--sim/d10v/d10v_sim.h1
-rw-r--r--sim/d10v/endian.c3
-rw-r--r--sim/d10v/gencode.c1
-rw-r--r--sim/d10v/interp.c4
-rw-r--r--sim/d10v/simops.c3
-rw-r--r--sim/erc32/ChangeLog6
-rw-r--r--sim/erc32/erc32.c4
-rw-r--r--sim/erc32/exec.c4
-rw-r--r--sim/erc32/float.c4
-rw-r--r--sim/erc32/func.c4
-rw-r--r--sim/erc32/help.c4
-rw-r--r--sim/erc32/interf.c4
-rw-r--r--sim/erc32/sis.c4
-rw-r--r--sim/erc32/sis.h1
-rw-r--r--sim/example-synacor/ChangeLog4
-rw-r--r--sim/example-synacor/interp.c3
-rw-r--r--sim/example-synacor/sim-main.c3
-rw-r--r--sim/frv/ChangeLog7
-rw-r--r--sim/frv/cache.c3
-rw-r--r--sim/frv/frv.c3
-rw-r--r--sim/frv/interrupts.c3
-rw-r--r--sim/frv/memory.c3
-rw-r--r--sim/frv/options.c3
-rw-r--r--sim/frv/pipeline.c3
-rw-r--r--sim/frv/profile-fr400.c6
-rw-r--r--sim/frv/profile-fr450.c6
-rw-r--r--sim/frv/profile-fr500.c6
-rw-r--r--sim/frv/profile-fr550.c6
-rw-r--r--sim/frv/profile.c6
-rw-r--r--sim/frv/registers.c3
-rw-r--r--sim/frv/reset.c3
-rw-r--r--sim/frv/sim-if.c3
-rw-r--r--sim/frv/sim-main.h4
-rw-r--r--sim/frv/traps.c3
-rw-r--r--sim/ft32/ChangeLog4
-rw-r--r--sim/ft32/interp.c4
-rw-r--r--sim/h8300/ChangeLog5
-rw-r--r--sim/h8300/compile.c4
-rw-r--r--sim/h8300/sim-main.h1
-rw-r--r--sim/iq2000/ChangeLog5
-rw-r--r--sim/iq2000/iq2000.c3
-rw-r--r--sim/iq2000/sim-if.c3
-rw-r--r--sim/iq2000/sim-main.h4
-rw-r--r--sim/lm32/ChangeLog5
-rw-r--r--sim/lm32/dv-lm32cpu.c3
-rw-r--r--sim/lm32/dv-lm32timer.c3
-rw-r--r--sim/lm32/dv-lm32uart.c3
-rw-r--r--sim/lm32/lm32.c3
-rw-r--r--sim/lm32/sim-if.c3
-rw-r--r--sim/lm32/traps.c3
-rw-r--r--sim/lm32/user.c3
-rw-r--r--sim/m32c/ChangeLog6
-rw-r--r--sim/m32c/gdb-if.c4
-rw-r--r--sim/m32c/int.c2
-rw-r--r--sim/m32c/load.c4
-rw-r--r--sim/m32c/main.c3
-rw-r--r--sim/m32c/mem.c3
-rw-r--r--sim/m32c/misc.c2
-rw-r--r--sim/m32c/opc2c.c2
-rw-r--r--sim/m32c/reg.c2
-rw-r--r--sim/m32c/srcdest.c2
-rw-r--r--sim/m32c/syscalls.c4
-rw-r--r--sim/m32c/trace.c4
-rw-r--r--sim/m32r/ChangeLog7
-rw-r--r--sim/m32r/dv-m32r_cache.c3
-rw-r--r--sim/m32r/dv-m32r_uart.c3
-rw-r--r--sim/m32r/m32r.c3
-rw-r--r--sim/m32r/m32r2.c3
-rw-r--r--sim/m32r/m32rx.c3
-rw-r--r--sim/m32r/sim-if.c3
-rw-r--r--sim/m32r/traps-linux.c3
-rw-r--r--sim/m32r/traps.c3
-rw-r--r--sim/m68hc11/ChangeLog6
-rw-r--r--sim/m68hc11/dv-m68hc11.c2
-rw-r--r--sim/m68hc11/dv-m68hc11eepr.c2
-rw-r--r--sim/m68hc11/dv-m68hc11sio.c2
-rw-r--r--sim/m68hc11/dv-m68hc11spi.c2
-rw-r--r--sim/m68hc11/dv-m68hc11tim.c2
-rw-r--r--sim/m68hc11/dv-nvram.c2
-rw-r--r--sim/m68hc11/emulos.c3
-rw-r--r--sim/m68hc11/gencode.c3
-rw-r--r--sim/m68hc11/interp.c3
-rw-r--r--sim/m68hc11/interrupts.c3
-rw-r--r--sim/m68hc11/m68hc11_sim.c3
-rw-r--r--sim/mcore/ChangeLog4
-rw-r--r--sim/mcore/interp.c4
-rw-r--r--sim/microblaze/ChangeLog4
-rw-r--r--sim/microblaze/interp.c4
-rw-r--r--sim/mips/ChangeLog7
-rw-r--r--sim/mips/cp1.c3
-rw-r--r--sim/mips/dsp.c3
-rw-r--r--sim/mips/dv-tx3904cpu.c2
-rw-r--r--sim/mips/dv-tx3904irc.c2
-rw-r--r--sim/mips/dv-tx3904sio.c2
-rw-r--r--sim/mips/dv-tx3904tmr.c2
-rw-r--r--sim/mips/interp.c7
-rw-r--r--sim/mips/m16run.c3
-rw-r--r--sim/mips/mdmx.c3
-rw-r--r--sim/mips/micromipsrun.c3
-rw-r--r--sim/mips/sim-main.c3
-rw-r--r--sim/mn10300/ChangeLog6
-rw-r--r--sim/mn10300/dv-mn103cpu.c2
-rw-r--r--sim/mn10300/dv-mn103int.c2
-rw-r--r--sim/mn10300/dv-mn103iop.c3
-rw-r--r--sim/mn10300/dv-mn103ser.c3
-rw-r--r--sim/mn10300/dv-mn103tim.c3
-rw-r--r--sim/mn10300/interp.c4
-rw-r--r--sim/mn10300/op_utils.c3
-rw-r--r--sim/moxie/ChangeLog4
-rw-r--r--sim/moxie/interp.c4
-rw-r--r--sim/msp430/ChangeLog4
-rw-r--r--sim/msp430/msp430-sim.c4
-rw-r--r--sim/or1k/ChangeLog5
-rw-r--r--sim/or1k/or1k.c3
-rw-r--r--sim/or1k/sim-if.c3
-rw-r--r--sim/or1k/sim-main.h2
-rw-r--r--sim/or1k/traps.c3
-rw-r--r--sim/ppc/ChangeLog7
-rw-r--r--sim/ppc/Makefile.in2
-rw-r--r--sim/ppc/basics.h3
-rw-r--r--sim/ppc/debug.c4
-rw-r--r--sim/ppc/defs.h26
-rw-r--r--sim/ppc/filter_filename.c4
-rw-r--r--sim/ppc/inline.c4
-rw-r--r--sim/ppc/sim-endian.c4
-rw-r--r--sim/ppc/words.h5
-rw-r--r--sim/pru/ChangeLog5
-rw-r--r--sim/pru/interp.c4
-rw-r--r--sim/pru/pru.h1
-rw-r--r--sim/pru/sim-main.h2
-rw-r--r--sim/riscv/ChangeLog4
-rw-r--r--sim/riscv/interp.c3
-rw-r--r--sim/riscv/machs.c3
-rw-r--r--sim/riscv/sim-main.c3
-rw-r--r--sim/rl78/ChangeLog5
-rw-r--r--sim/rl78/cpu.c4
-rw-r--r--sim/rl78/gdb-if.c4
-rw-r--r--sim/rl78/load.c3
-rw-r--r--sim/rl78/main.c3
-rw-r--r--sim/rl78/mem.c4
-rw-r--r--sim/rl78/rl78.c4
-rw-r--r--sim/rl78/trace.c3
-rw-r--r--sim/rx/ChangeLog6
-rw-r--r--sim/rx/err.c3
-rw-r--r--sim/rx/fpu.c4
-rw-r--r--sim/rx/gdb-if.c4
-rw-r--r--sim/rx/load.c3
-rw-r--r--sim/rx/main.c3
-rw-r--r--sim/rx/mem.c4
-rw-r--r--sim/rx/misc.c3
-rw-r--r--sim/rx/reg.c3
-rw-r--r--sim/rx/rx.c4
-rw-r--r--sim/rx/syscalls.c3
-rw-r--r--sim/rx/trace.c3
-rw-r--r--sim/sh/ChangeLog4
-rw-r--r--sim/sh/interp.c3
-rw-r--r--sim/v850/ChangeLog5
-rw-r--r--sim/v850/interp.c3
-rw-r--r--sim/v850/sim-main.h1
-rw-r--r--sim/v850/simops.c3
302 files changed, 923 insertions, 169 deletions
diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog
index dc3eee25dd..b5ef612e6f 100644
--- a/sim/aarch64/ChangeLog
+++ b/sim/aarch64/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * cpustate.c: Include defs.h.
+ * interp.c: Replace config.h include with defs.h.
+ * memory.c, simulator.c: Likewise.
+ * cpustate.h, simulator.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/aarch64/cpustate.c b/sim/aarch64/cpustate.c
index f6b93fbb1a..6007d74872 100644
--- a/sim/aarch64/cpustate.c
+++ b/sim/aarch64/cpustate.c
@@ -19,6 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <math.h>
diff --git a/sim/aarch64/cpustate.h b/sim/aarch64/cpustate.h
index c3f26376f4..b9e1f92d64 100644
--- a/sim/aarch64/cpustate.h
+++ b/sim/aarch64/cpustate.h
@@ -22,7 +22,6 @@
#ifndef _CPU_STATE_H
#define _CPU_STATE_H
-#include "config.h"
#include <sys/types.h>
#include <stdint.h>
#include <inttypes.h>
diff --git a/sim/aarch64/interp.c b/sim/aarch64/interp.c
index cc3cf6add3..fd35f4fa68 100644
--- a/sim/aarch64/interp.c
+++ b/sim/aarch64/interp.c
@@ -19,7 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <assert.h>
#include <signal.h>
diff --git a/sim/aarch64/memory.c b/sim/aarch64/memory.c
index aa2f2e5fc2..22caf61707 100644
--- a/sim/aarch64/memory.c
+++ b/sim/aarch64/memory.c
@@ -19,7 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c
index a8391212c0..be1c298763 100644
--- a/sim/aarch64/simulator.c
+++ b/sim/aarch64/simulator.c
@@ -19,7 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/sim/aarch64/simulator.h b/sim/aarch64/simulator.h
index f80e1f2eba..5875c843e9 100644
--- a/sim/aarch64/simulator.h
+++ b/sim/aarch64/simulator.h
@@ -22,7 +22,6 @@
#ifndef _SIMULATOR_H
#define _SIMULATOR_H
-#include "config.h"
#include <sys/types.h>
#include <setjmp.h>
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index c85e70563a..aabdae2241 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * armcopro.c, armemu.c, arminit.c, armsupp.c, armvirt.c, iwmmxt.c,
+ maverick.c, thumbemu.c: Include defs.h.
+ * armos.c, wrapper.c: Replace config.h include with defs.h.
+ * armdefs.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/arm/armcopro.c b/sim/arm/armcopro.c
index 9227fc097a..5cd33fb3ae 100644
--- a/sim/arm/armcopro.c
+++ b/sim/arm/armcopro.c
@@ -14,6 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "armdefs.h"
#include "armos.h"
#include "armemu.h"
diff --git a/sim/arm/armdefs.h b/sim/arm/armdefs.h
index 68cf199db6..7df5d02294 100644
--- a/sim/arm/armdefs.h
+++ b/sim/arm/armdefs.h
@@ -14,7 +14,6 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
diff --git a/sim/arm/armemu.c b/sim/arm/armemu.c
index f93ad0cee2..ab7454628b 100644
--- a/sim/arm/armemu.c
+++ b/sim/arm/armemu.c
@@ -15,6 +15,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "armdefs.h"
#include "armemu.h"
#include "armos.h"
diff --git a/sim/arm/arminit.c b/sim/arm/arminit.c
index 3a626c8467..bc5456f47b 100644
--- a/sim/arm/arminit.c
+++ b/sim/arm/arminit.c
@@ -14,6 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <string.h>
#include "armdefs.h"
diff --git a/sim/arm/armos.c b/sim/arm/armos.c
index 72bdf59971..a3713a5c33 100644
--- a/sim/arm/armos.c
+++ b/sim/arm/armos.c
@@ -21,7 +21,9 @@
fun, and definign VAILDATE will define SWI 1 to enter SVC mode, and SWI
0x11 to halt the emulator. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ansidecl.h"
#include "libiberty.h"
diff --git a/sim/arm/armsupp.c b/sim/arm/armsupp.c
index 11bb53c5b7..1a5eeaff1d 100644
--- a/sim/arm/armsupp.c
+++ b/sim/arm/armsupp.c
@@ -14,6 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "armdefs.h"
#include "armemu.h"
#include "ansidecl.h"
diff --git a/sim/arm/armvirt.c b/sim/arm/armvirt.c
index 4f95ed838f..ba01a652eb 100644
--- a/sim/arm/armvirt.c
+++ b/sim/arm/armvirt.c
@@ -22,6 +22,9 @@
freed as they might be needed again. A single area of memory may be
defined to generate aborts. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "armos.h"
#include "armdefs.h"
#include "ansidecl.h"
diff --git a/sim/arm/iwmmxt.c b/sim/arm/iwmmxt.c
index 8e81824864..c71d06f4c6 100644
--- a/sim/arm/iwmmxt.c
+++ b/sim/arm/iwmmxt.c
@@ -15,6 +15,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdlib.h>
#include <string.h>
diff --git a/sim/arm/maverick.c b/sim/arm/maverick.c
index 15041b63cc..fb62ccd8c8 100644
--- a/sim/arm/maverick.c
+++ b/sim/arm/maverick.c
@@ -15,6 +15,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <assert.h>
#include "armdefs.h"
#include "ansidecl.h"
diff --git a/sim/arm/thumbemu.c b/sim/arm/thumbemu.c
index fa70d5bfcf..6915d23ec4 100644
--- a/sim/arm/thumbemu.c
+++ b/sim/arm/thumbemu.c
@@ -18,6 +18,9 @@
instruction into its corresponding ARM instruction, and using the
existing ARM simulator. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#ifndef MODET /* required for the Thumb instruction support */
#if 1
#error "MODET needs to be defined for the Thumb world to work"
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index d25184afa0..a1147e402c 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -20,7 +20,9 @@
run.c and gdb (when the simulator is linked with gdb).
All simulator interaction should go through this file. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/sim/avr/ChangeLog b/sim/avr/ChangeLog
index ce0978394b..2a979aa6d9 100644
--- a/sim/avr/ChangeLog
+++ b/sim/avr/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/avr/interp.c b/sim/avr/interp.c
index df1f6e5540..75a10efe90 100644
--- a/sim/avr/interp.c
+++ b/sim/avr/interp.c
@@ -17,7 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <string.h>
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 84e1dd34a5..c9b64b11f4 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,18 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * bfin-sim.c, devices.c, dv-bfin_cec.c, dv-bfin_ctimer.c,
+ dv-bfin_dma.c, dv-bfin_dmac.c, dv-bfin_ebiu_amc.c,
+ dv-bfin_ebiu_ddrc.c, dv-bfin_ebiu_sdc.c, dv-bfin_emac.c,
+ dv-bfin_eppi.c, dv-bfin_evt.c, dv-bfin_gpio.c, dv-bfin_gpio2.c,
+ dv-bfin_gptimer.c, dv-bfin_jtag.c, dv-bfin_mmu.c, dv-bfin_nfc.c,
+ dv-bfin_otp.c, dv-bfin_pfmon.c, dv-bfin_pint.c, dv-bfin_pll.c,
+ dv-bfin_ppi.c, dv-bfin_rtc.c, dv-bfin_sic.c, dv-bfin_spi.c,
+ dv-bfin_trace.c, dv-bfin_twi.c, dv-bfin_uart.c, dv-bfin_uart2.c,
+ dv-bfin_wdog.c, dv-bfin_wp.c, dv-eth_phy.c, gui.c, interp.c,
+ machs.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 33bbc6e496..486fe4717e 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/bfin/devices.c b/sim/bfin/devices.c
index aadb9bcf1f..97873f6f59 100644
--- a/sim/bfin/devices.c
+++ b/sim/bfin/devices.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-hw.h"
diff --git a/sim/bfin/dv-bfin_cec.c b/sim/bfin/dv-bfin_cec.c
index 2236830d24..6179b16ad8 100644
--- a/sim/bfin/dv-bfin_cec.c
+++ b/sim/bfin/dv-bfin_cec.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ctimer.c b/sim/bfin/dv-bfin_ctimer.c
index beb4a0e76f..df62d9487e 100644
--- a/sim/bfin/dv-bfin_ctimer.c
+++ b/sim/bfin/dv-bfin_ctimer.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_dma.c b/sim/bfin/dv-bfin_dma.c
index e3834d7614..d7dc541dd8 100644
--- a/sim/bfin/dv-bfin_dma.c
+++ b/sim/bfin/dv-bfin_dma.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdlib.h>
diff --git a/sim/bfin/dv-bfin_dmac.c b/sim/bfin/dv-bfin_dmac.c
index ae720cb8b6..d5c608f4cd 100644
--- a/sim/bfin/dv-bfin_dmac.c
+++ b/sim/bfin/dv-bfin_dmac.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-hw.h"
diff --git a/sim/bfin/dv-bfin_ebiu_amc.c b/sim/bfin/dv-bfin_ebiu_amc.c
index 67f557d29b..29c4c4a5a9 100644
--- a/sim/bfin/dv-bfin_ebiu_amc.c
+++ b/sim/bfin/dv-bfin_ebiu_amc.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ebiu_ddrc.c b/sim/bfin/dv-bfin_ebiu_ddrc.c
index 4206c25377..4160cb210e 100644
--- a/sim/bfin/dv-bfin_ebiu_ddrc.c
+++ b/sim/bfin/dv-bfin_ebiu_ddrc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ebiu_sdc.c b/sim/bfin/dv-bfin_ebiu_sdc.c
index d542f02c08..4af04dcdac 100644
--- a/sim/bfin/dv-bfin_ebiu_sdc.c
+++ b/sim/bfin/dv-bfin_ebiu_sdc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_emac.c b/sim/bfin/dv-bfin_emac.c
index 249aef6b9d..e5ceedbef5 100644
--- a/sim/bfin/dv-bfin_emac.c
+++ b/sim/bfin/dv-bfin_emac.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <errno.h>
#include <fcntl.h>
diff --git a/sim/bfin/dv-bfin_eppi.c b/sim/bfin/dv-bfin_eppi.c
index ad36a943f2..169895d3dd 100644
--- a/sim/bfin/dv-bfin_eppi.c
+++ b/sim/bfin/dv-bfin_eppi.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_evt.c b/sim/bfin/dv-bfin_evt.c
index c4cf691da9..e49f4804fe 100644
--- a/sim/bfin/dv-bfin_evt.c
+++ b/sim/bfin/dv-bfin_evt.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gpio.c b/sim/bfin/dv-bfin_gpio.c
index 2830aa3847..bbcc54f0fb 100644
--- a/sim/bfin/dv-bfin_gpio.c
+++ b/sim/bfin/dv-bfin_gpio.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gpio2.c b/sim/bfin/dv-bfin_gpio2.c
index 2933ad15b8..61c99802c1 100644
--- a/sim/bfin/dv-bfin_gpio2.c
+++ b/sim/bfin/dv-bfin_gpio2.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gptimer.c b/sim/bfin/dv-bfin_gptimer.c
index 8f2b476eeb..3dfa2b58e9 100644
--- a/sim/bfin/dv-bfin_gptimer.c
+++ b/sim/bfin/dv-bfin_gptimer.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_jtag.c b/sim/bfin/dv-bfin_jtag.c
index d97b9eac82..12629970cc 100644
--- a/sim/bfin/dv-bfin_jtag.c
+++ b/sim/bfin/dv-bfin_jtag.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_mmu.c b/sim/bfin/dv-bfin_mmu.c
index cbaaaa2cae..cadc9df552 100644
--- a/sim/bfin/dv-bfin_mmu.c
+++ b/sim/bfin/dv-bfin_mmu.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-options.h"
diff --git a/sim/bfin/dv-bfin_nfc.c b/sim/bfin/dv-bfin_nfc.c
index a26cb13990..80fe49da72 100644
--- a/sim/bfin/dv-bfin_nfc.c
+++ b/sim/bfin/dv-bfin_nfc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_otp.c b/sim/bfin/dv-bfin_otp.c
index e11e04e967..6cf1c8155c 100644
--- a/sim/bfin/dv-bfin_otp.c
+++ b/sim/bfin/dv-bfin_otp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pfmon.c b/sim/bfin/dv-bfin_pfmon.c
index 2216c06456..bffe67b18a 100644
--- a/sim/bfin/dv-bfin_pfmon.c
+++ b/sim/bfin/dv-bfin_pfmon.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pint.c b/sim/bfin/dv-bfin_pint.c
index 90b3190c02..b4f4f40ab6 100644
--- a/sim/bfin/dv-bfin_pint.c
+++ b/sim/bfin/dv-bfin_pint.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pll.c b/sim/bfin/dv-bfin_pll.c
index 5ba1a6afaf..e2a5f5cd55 100644
--- a/sim/bfin/dv-bfin_pll.c
+++ b/sim/bfin/dv-bfin_pll.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "machs.h"
diff --git a/sim/bfin/dv-bfin_ppi.c b/sim/bfin/dv-bfin_ppi.c
index e319df9144..a67dc5eecb 100644
--- a/sim/bfin/dv-bfin_ppi.c
+++ b/sim/bfin/dv-bfin_ppi.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_rtc.c b/sim/bfin/dv-bfin_rtc.c
index 5486ac8287..06ae4249d6 100644
--- a/sim/bfin/dv-bfin_rtc.c
+++ b/sim/bfin/dv-bfin_rtc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <time.h>
#include "sim-main.h"
diff --git a/sim/bfin/dv-bfin_sic.c b/sim/bfin/dv-bfin_sic.c
index 94e55f21ee..cc90a4cf22 100644
--- a/sim/bfin/dv-bfin_sic.c
+++ b/sim/bfin/dv-bfin_sic.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_spi.c b/sim/bfin/dv-bfin_spi.c
index 8fdd9dbc51..c0869fcf77 100644
--- a/sim/bfin/dv-bfin_spi.c
+++ b/sim/bfin/dv-bfin_spi.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_trace.c b/sim/bfin/dv-bfin_trace.c
index ab8220f7a1..56fad63cd3 100644
--- a/sim/bfin/dv-bfin_trace.c
+++ b/sim/bfin/dv-bfin_trace.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_twi.c b/sim/bfin/dv-bfin_twi.c
index 87794f5385..00b080f122 100644
--- a/sim/bfin/dv-bfin_twi.c
+++ b/sim/bfin/dv-bfin_twi.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_uart.c b/sim/bfin/dv-bfin_uart.c
index d013621750..7aa843065b 100644
--- a/sim/bfin/dv-bfin_uart.c
+++ b/sim/bfin/dv-bfin_uart.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "dv-sockser.h"
diff --git a/sim/bfin/dv-bfin_uart2.c b/sim/bfin/dv-bfin_uart2.c
index 2fd540164d..a7985889f8 100644
--- a/sim/bfin/dv-bfin_uart2.c
+++ b/sim/bfin/dv-bfin_uart2.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_wdog.c b/sim/bfin/dv-bfin_wdog.c
index 4be19aa645..850ae0618d 100644
--- a/sim/bfin/dv-bfin_wdog.c
+++ b/sim/bfin/dv-bfin_wdog.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "dv-sockser.h"
diff --git a/sim/bfin/dv-bfin_wp.c b/sim/bfin/dv-bfin_wp.c
index 28626a569f..189c121d97 100644
--- a/sim/bfin/dv-bfin_wp.c
+++ b/sim/bfin/dv-bfin_wp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-eth_phy.c b/sim/bfin/dv-eth_phy.c
index 14aafee919..486054277c 100644
--- a/sim/bfin/dv-eth_phy.c
+++ b/sim/bfin/dv-eth_phy.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/gui.c b/sim/bfin/gui.c
index 029a22ef3b..8e84d2dff9 100644
--- a/sim/bfin/gui.c
+++ b/sim/bfin/gui.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#ifdef HAVE_SDL
# include <SDL.h>
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index aa5c245c82..8e3a1214b7 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/bfin/machs.c b/sim/bfin/machs.c
index a2060e8d89..e94af5d0f5 100644
--- a/sim/bfin/machs.c
+++ b/sim/bfin/machs.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdlib.h>
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog
index 689c76bd45..69156e6fa1 100644
--- a/sim/bpf/ChangeLog
+++ b/sim/bpf/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * bpf-helpers.c, bpf.c, sim-if.c, traps.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/bpf/bpf-helpers.c b/sim/bpf/bpf-helpers.c
index d7760d5726..c308812ab1 100644
--- a/sim/bpf/bpf-helpers.c
+++ b/sim/bpf/bpf-helpers.c
@@ -21,6 +21,9 @@
implementation of the helpers, which can be customized by the
user. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_BPFBF
#define WANT_CPU bpfbf
diff --git a/sim/bpf/bpf.c b/sim/bpf/bpf.c
index a0cc803da8..c626781adb 100644
--- a/sim/bpf/bpf.c
+++ b/sim/bpf/bpf.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_BPFBF
#define WANT_CPU bpfbf
diff --git a/sim/bpf/sim-if.c b/sim/bpf/sim-if.c
index c2c01fc547..185e96dd7b 100644
--- a/sim/bpf/sim-if.c
+++ b/sim/bpf/sim-if.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdlib.h>
#include "sim-main.h"
diff --git a/sim/bpf/traps.c b/sim/bpf/traps.c
index b58d17f040..85da1cba02 100644
--- a/sim/bpf/traps.c
+++ b/sim/bpf/traps.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU bpfbf
#define WANT_CPU_BPFBF
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index b221166212..1d875bb1cb 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,24 @@
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
+ * callback.c: Replace config.h include with defs.h.
+ * cgen-accfp.c, cgen-fpu.c, cgen-par.c, cgen-run.c, cgen-scache.c,
+ dv-core.c, dv-glue.c, genmloop.sh, hw-alloc.c, hw-base.c, hw-device.c,
+ hw-events.c, hw-handles.c, hw-instances.c, hw-ports.c,
+ hw-properties.c, hw-tree.c, sim-abort.c, sim-arange.c, sim-bits.c,
+ sim-close.c, sim-command.c, sim-config.c, sim-core.c, sim-cpu.c,
+ sim-endian.c, sim-engine.c, sim-events.c, sim-fpu.c, sim-hload.c,
+ sim-hrw.c, sim-hw.c, sim-info.c, sim-inline.c, sim-model.c,
+ sim-profile.c, sim-reason.c, sim-reg.c, sim-resume.c, sim-run.c,
+ sim-signal.c, sim-stop.c, sim-trace.c, sim-utils.c: Include defs.h.
+ * cgen-trace.c, cgen-utils.c, dv-cfi.c, dv-pal.c, dv-sockser.c,
+ nrun.c, sim-basics.h, sim-load.c, sim-memopt.c, sim-module.c,
+ sim-options.c, sim-syscall.c, sim-watch.c, syscall.c: Replace
+ config.h include with defs.h.
+ * gentmap.c (gen_targ_map_c): Replace config.h with defs.h.
+ * sim-io.c: Include defs.h.
+ (open): Undefine.
+ * defs.h: New file.
+
2021-05-15 Mike Frysinger <vapier@gentoo.org>
* nrun.c: Include environ.h.
diff --git a/sim/common/callback.c b/sim/common/callback.c
index 24ea47025e..f2587a4525 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -20,9 +20,9 @@
/* This file provides a standard way for targets to talk to the host OS
level. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ansidecl.h"
#include <stdarg.h>
#include <stdio.h>
diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c
index d6cd751e2b..345cfe81eb 100644
--- a/sim/common/cgen-accfp.c
+++ b/sim/common/cgen-accfp.c
@@ -11,6 +11,9 @@
- proper rounding
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-fpu.h"
diff --git a/sim/common/cgen-fpu.c b/sim/common/cgen-fpu.c
index 3a8d5199be..1b035eae34 100644
--- a/sim/common/cgen-fpu.c
+++ b/sim/common/cgen-fpu.c
@@ -1,6 +1,9 @@
/* CGEN fpu support
Copyright (C) 1999 Cygnus Solutions. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-fpu.h"
diff --git a/sim/common/cgen-par.c b/sim/common/cgen-par.c
index 4cf0388e16..b535edfdae 100644
--- a/sim/common/cgen-par.c
+++ b/sim/common/cgen-par.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <stdlib.h>
#include "cgen-mem.h"
diff --git a/sim/common/cgen-run.c b/sim/common/cgen-run.c
index 1458c4e5d1..443b62a0bb 100644
--- a/sim/common/cgen-run.c
+++ b/sim/common/cgen-run.c
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
When the framework is more modular, this can be.
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c
index 56df075f68..f1c7571484 100644
--- a/sim/common/cgen-scache.c
+++ b/sim/common/cgen-scache.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define SCACHE_DEFINE_INLINE
#include "sim-main.h"
diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c
index ea0399fdb6..66250c09be 100644
--- a/sim/common/cgen-trace.c
+++ b/sim/common/cgen-trace.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <errno.h>
#include <stdlib.h>
#include "dis-asm.h"
diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c
index 602abcba18..890ed0218d 100644
--- a/sim/common/cgen-utils.c
+++ b/sim/common/cgen-utils.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "bfd.h"
#include "sim-main.h"
#include "dis-asm.h"
diff --git a/sim/common/defs.h b/sim/common/defs.h
new file mode 100644
index 0000000000..3a0737cb9b
--- /dev/null
+++ b/sim/common/defs.h
@@ -0,0 +1,30 @@
+/* The configure generated header settings.
+
+ Copyright 2002-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 of the License, 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 <http://www.gnu.org/licenses/>. */
+
+/* This file should be included by every .c file before any other header. */
+
+#ifndef DEFS_H
+#define DEFS_H
+
+#ifdef HAVE_CONFIG_H
+
+/* Include sim's various configure tests. */
+#include "config.h"
+
+#endif
+
+#endif
diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c
index b865227175..02a2cedd55 100644
--- a/sim/common/dv-cfi.c
+++ b/sim/common/dv-cfi.c
@@ -22,7 +22,8 @@
/* TODO: support vendor query tables. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <math.h>
#include <errno.h>
diff --git a/sim/common/dv-core.c b/sim/common/dv-core.c
index be56aa4629..c596da45c9 100644
--- a/sim/common/dv-core.c
+++ b/sim/common/dv-core.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/common/dv-glue.c b/sim/common/dv-glue.c
index 8bda326157..7c8e1f877a 100644
--- a/sim/common/dv-glue.c
+++ b/sim/common/dv-glue.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
diff --git a/sim/common/dv-pal.c b/sim/common/dv-pal.c
index dd4ab4fb39..c60f524ea8 100644
--- a/sim/common/dv-pal.c
+++ b/sim/common/dv-pal.c
@@ -19,7 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
#include "sim-io.h"
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index 73c473b15c..ef652f62f4 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -18,7 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* FIXME: will obviously need to evolve.
- connectionless sockets might be more appropriate. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <string.h>
diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index 460a26c31e..fa4e7b90a5 100755
--- a/sim/common/genmloop.sh
+++ b/sim/common/genmloop.sh
@@ -301,6 +301,9 @@ exec 1>tmp-mloop-$$.cin
cat << EOF
/* This file is generated by the genmloop script. DO NOT EDIT! */
+/* This must come before any other includes. */
+#include "defs.h"
+
/* Enable switch() support in cgen headers. */
#define SEM_IN_SWITCH
diff --git a/sim/common/gentmap.c b/sim/common/gentmap.c
index 8085c3576a..254ec3f111 100644
--- a/sim/common/gentmap.c
+++ b/sim/common/gentmap.c
@@ -67,7 +67,7 @@ gen_targ_map_c (void)
printf ("/* Target value mapping utilities needed by the simulator and gdb. */\n");
printf ("/* This file is machine generated by gentmap.c. */\n\n");
- printf ("#include \"config.h\"\n");
+ printf ("#include \"defs.h\"\n");
printf ("#include <errno.h>\n");
printf ("#include <fcntl.h>\n");
printf ("#include \"ansidecl.h\"\n");
diff --git a/sim/common/hw-alloc.c b/sim/common/hw-alloc.c
index 141dc21167..a16666b931 100644
--- a/sim/common/hw-alloc.c
+++ b/sim/common/hw-alloc.c
@@ -17,6 +17,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-base.c b/sim/common/hw-base.c
index af8b181248..af4cc50f1a 100644
--- a/sim/common/hw-base.c
+++ b/sim/common/hw-base.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-device.c b/sim/common/hw-device.c
index bc91264c02..9b743ead1f 100644
--- a/sim/common/hw-device.c
+++ b/sim/common/hw-device.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-events.c b/sim/common/hw-events.c
index 81628f0b64..620b47d525 100644
--- a/sim/common/hw-events.c
+++ b/sim/common/hw-events.c
@@ -17,6 +17,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-handles.c b/sim/common/hw-handles.c
index bbd08f632f..fb878e4927 100644
--- a/sim/common/hw-handles.c
+++ b/sim/common/hw-handles.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-instances.c b/sim/common/hw-instances.c
index 6227c0a234..9d786198fd 100644
--- a/sim/common/hw-instances.c
+++ b/sim/common/hw-instances.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-ports.c b/sim/common/hw-ports.c
index 50e2cbc30e..fbc7278ddd 100644
--- a/sim/common/hw-ports.c
+++ b/sim/common/hw-ports.c
@@ -17,6 +17,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-properties.c b/sim/common/hw-properties.c
index 11a371cea0..3836aa7352 100644
--- a/sim/common/hw-properties.c
+++ b/sim/common/hw-properties.c
@@ -19,6 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/hw-tree.c b/sim/common/hw-tree.c
index 4d50ec6ed6..1bf4edab74 100644
--- a/sim/common/hw-tree.c
+++ b/sim/common/hw-tree.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "hw-main.h"
#include "hw-base.h"
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index 8a1b3c19ac..2cccff6a21 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Need to be before general includes, to pick up e.g. _GNU_SOURCE. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "defs.h"
#include <signal.h>
#include <stdlib.h>
diff --git a/sim/common/sim-abort.c b/sim/common/sim-abort.c
index bf05504255..06df127c19 100644
--- a/sim/common/sim-abort.c
+++ b/sim/common/sim-abort.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/common/sim-arange.c b/sim/common/sim-arange.c
index a40dabbeb7..5a28a2c0c4 100644
--- a/sim/common/sim-arange.c
+++ b/sim/common/sim-arange.c
@@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _SIM_ARANGE_C_
#define _SIM_ARANGE_C_
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "libiberty.h"
#include "sim-basics.h"
#include "sim-arange.h"
diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index 7d9c831da5..25c1193dca 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -26,9 +26,7 @@
/* Basic configuration */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "defs.h"
/* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
bring potential conflicts out in the open */
diff --git a/sim/common/sim-bits.c b/sim/common/sim-bits.c
index 9e9063cb59..4be07521b0 100644
--- a/sim/common/sim-bits.c
+++ b/sim/common/sim-bits.c
@@ -23,6 +23,9 @@
#ifndef _SIM_BITS_C_
#define _SIM_BITS_C_
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-basics.h"
#include "sim-assert.h"
#include "sim-io.h"
diff --git a/sim/common/sim-close.c b/sim/common/sim-close.c
index e64d59e636..c774d453bf 100644
--- a/sim/common/sim-close.c
+++ b/sim/common/sim-close.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-module.h"
#include "sim/sim.h"
diff --git a/sim/common/sim-command.c b/sim/common/sim-command.c
index d49ac8a262..b5ba2c0505 100644
--- a/sim/common/sim-command.c
+++ b/sim/common/sim-command.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "sim-utils.h"
diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c
index 2acd1e4f77..df99d6a957 100644
--- a/sim/common/sim-config.c
+++ b/sim/common/sim-config.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c
index 222f9fd8fe..6604f31ea9 100644
--- a/sim/common/sim-core.c
+++ b/sim/common/sim-core.c
@@ -23,6 +23,9 @@
#ifndef SIM_CORE_C
#define SIM_CORE_C
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "libiberty.h"
diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c
index 552e48c197..587a3e8c9e 100644
--- a/sim/common/sim-cpu.c
+++ b/sim/common/sim-cpu.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdlib.h>
#include "sim-main.h"
diff --git a/sim/common/sim-endian.c b/sim/common/sim-endian.c
index 395b487ee8..5f0e46a84e 100644
--- a/sim/common/sim-endian.c
+++ b/sim/common/sim-endian.c
@@ -23,6 +23,9 @@
#ifndef _SIM_ENDIAN_C_
#define _SIM_ENDIAN_C_
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-basics.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c
index fcdf284127..a5f84af280 100644
--- a/sim/common/sim-engine.c
+++ b/sim/common/sim-engine.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-events.c b/sim/common/sim-events.c
index 60e4c55a87..5a5798d102 100644
--- a/sim/common/sim-events.c
+++ b/sim/common/sim-events.c
@@ -23,6 +23,9 @@
#ifndef _SIM_EVENTS_C_
#define _SIM_EVENTS_C_
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-cpu.h"
diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c
index bff5b08b5e..fe8ecf8a3c 100644
--- a/sim/common/sim-fpu.c
+++ b/sim/common/sim-fpu.c
@@ -35,6 +35,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_FPU_C
#define SIM_FPU_C
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-basics.h"
#include "sim-fpu.h"
diff --git a/sim/common/sim-hload.c b/sim/common/sim-hload.c
index 243437dba1..f33dcf6368 100644
--- a/sim/common/sim-hload.c
+++ b/sim/common/sim-hload.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "bfd.h"
#include "sim-utils.h"
diff --git a/sim/common/sim-hrw.c b/sim/common/sim-hrw.c
index 920cc16068..3df91d2b71 100644
--- a/sim/common/sim-hrw.c
+++ b/sim/common/sim-hrw.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c
index 984817f25f..95d95042de 100644
--- a/sim/common/sim-hw.c
+++ b/sim/common/sim-hw.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-options.h"
diff --git a/sim/common/sim-info.c b/sim/common/sim-info.c
index 7dcb656f81..3c92c87faa 100644
--- a/sim/common/sim-info.c
+++ b/sim/common/sim-info.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-inline.c b/sim/common/sim-inline.c
index 93ea6f03ca..7c3edd0d1c 100644
--- a/sim/common/sim-inline.c
+++ b/sim/common/sim-inline.c
@@ -26,6 +26,9 @@
#undef SIM_INLINE_P
#define SIM_INLINE_P 1
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-inline.h"
#include "sim-main.h"
diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c
index edef26e8e1..b5e874bef7 100644
--- a/sim/common/sim-io.c
+++ b/sim/common/sim-io.c
@@ -19,6 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-io.h"
@@ -35,6 +37,8 @@
#include <stdlib.h>
+#undef open
+
/* Define the rate at which the simulator should poll the host
for a quit. */
#ifndef POLL_QUIT_INTERVAL
diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c
index b9d85ca2fd..3ea50e7fbc 100644
--- a/sim/common/sim-load.c
+++ b/sim/common/sim-load.c
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
as it is used by simulators that don't use it [though that doesn't mean
to suggest that they shouldn't :-)]. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ansidecl.h"
#include <stdio.h> /* for NULL */
#include <stdarg.h>
diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c
index a102d74ecd..636f6a9a0f 100644
--- a/sim/common/sim-memopt.c
+++ b/sim/common/sim-memopt.c
@@ -17,7 +17,8 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c
index 5596656eff..e1af9d4b1e 100644
--- a/sim/common/sim-model.c
+++ b/sim/common/sim-model.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-model.h"
#include "libiberty.h"
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index 3bb7db0df7..97d619c4ae 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -19,7 +19,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-io.h"
#include "sim-options.h"
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index ff325e6cc5..06bd5826ef 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <string.h>
#include <stdlib.h>
diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c
index 455e1a246d..f2d65e0930 100644
--- a/sim/common/sim-profile.c
+++ b/sim/common/sim-profile.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-io.h"
#include "sim-options.h"
diff --git a/sim/common/sim-reason.c b/sim/common/sim-reason.c
index 0f128c2a42..73a57654c2 100644
--- a/sim/common/sim-reason.c
+++ b/sim/common/sim-reason.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-reg.c b/sim/common/sim-reg.c
index 457ac223da..ee340884aa 100644
--- a/sim/common/sim-reg.c
+++ b/sim/common/sim-reg.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-resume.c b/sim/common/sim-resume.c
index 6fe9a4233f..8f854da847 100644
--- a/sim/common/sim-resume.c
+++ b/sim/common/sim-resume.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-run.c b/sim/common/sim-run.c
index 54f6286f09..f2e477e336 100644
--- a/sim/common/sim-run.c
+++ b/sim/common/sim-run.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-signal.c b/sim/common/sim-signal.c
index 9596847af5..f9fef4c24c 100644
--- a/sim/common/sim-signal.c
+++ b/sim/common/sim-signal.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include "sim-main.h"
diff --git a/sim/common/sim-stop.c b/sim/common/sim-stop.c
index 305c455dc4..aa48fc3e6f 100644
--- a/sim/common/sim-stop.c
+++ b/sim/common/sim-stop.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c
index 9dbc71ac9f..0f7601cafd 100644
--- a/sim/common/sim-syscall.c
+++ b/sim/common/sim-syscall.c
@@ -17,7 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <errno.h>
diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c
index 26d9556322..b8224e0b83 100644
--- a/sim/common/sim-trace.c
+++ b/sim/common/sim-trace.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-io.h"
#include "sim-options.h"
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c
index 86ab059744..abb87f8c5a 100644
--- a/sim/common/sim-utils.c
+++ b/sim/common/sim-utils.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c
index 8630b063bb..fa035b3805 100644
--- a/sim/common/sim-watch.c
+++ b/sim/common/sim-watch.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
diff --git a/sim/common/syscall.c b/sim/common/syscall.c
index 0a1d3f4114..4e76d2008a 100644
--- a/sim/common/syscall.c
+++ b/sim/common/syscall.c
@@ -23,9 +23,9 @@
tree, nor should it live in the gdb source tree. K&R C must be
supported. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ansidecl.h"
#include "libiberty.h"
#include <stdarg.h>
diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog
index d311b2db6f..1a7341d2e8 100644
--- a/sim/cr16/ChangeLog
+++ b/sim/cr16/ChangeLog
@@ -1,5 +1,14 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * cr16_sim.h: Delete config.h include.
+ * gencode.c: Replace config.h include with defs.h.
+ (write_template): Output defs.h include.
+ (write_opcodes): Likewise.
+ * interp.c: Replace config.h include with defs.h.
+ * simops.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/cr16/cr16_sim.h b/sim/cr16/cr16_sim.h
index c3d590d537..a865d09364 100644
--- a/sim/cr16/cr16_sim.h
+++ b/sim/cr16/cr16_sim.h
@@ -18,7 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
diff --git a/sim/cr16/gencode.c b/sim/cr16/gencode.c
index 335ab2607f..30fda931c8 100644
--- a/sim/cr16/gencode.c
+++ b/sim/cr16/gencode.c
@@ -17,8 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
@@ -67,6 +68,7 @@ write_template (void)
{
int i = 0,j, k, flags;
+ printf ("#include \"defs.h\"\n");
printf ("#include \"sim-main.h\"\n");
printf ("#include \"simops.h\"\n\n");
@@ -131,6 +133,7 @@ write_opcodes (void)
int i = 0, j = 0, k;
/* write out opcode table. */
+ printf ("#include \"defs.h\"\n");
printf ("#include \"sim-main.h\"\n");
printf ("#include \"simops.h\"\n\n");
printf ("struct simops Simops[] = {\n");
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c
index 7db7f56e21..7f6b07fe28 100644
--- a/sim/cr16/interp.c
+++ b/sim/cr16/interp.c
@@ -17,7 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <inttypes.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c
index ca96dd0758..b383dfa1f9 100644
--- a/sim/cr16/simops.c
+++ b/sim/cr16/simops.c
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <signal.h>
#include <errno.h>
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index 01645b57f9..80b0d7cb73 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * cris-tmpl.c, crisv10f.c, crisv32f.c, dv-cris.c, dv-cris_900000xx.c,
+ dv-rv.c, traps.c: Include defs.h.
+ * rvdummy.c, sim-if.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-15 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c
index 95579dbffa..c1153058cf 100644
--- a/sim/cris/cris-tmpl.c
+++ b/sim/cris/cris-tmpl.c
@@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* The infrastructure is based on that of i960.c. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#include "sim-main.h"
diff --git a/sim/cris/crisv10f.c b/sim/cris/crisv10f.c
index 69bfbc851e..c649eff691 100644
--- a/sim/cris/crisv10f.c
+++ b/sim/cris/crisv10f.c
@@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* The infrastructure is based on that of i960.c. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_CRISV10F
#define BASENUM 10
diff --git a/sim/cris/crisv32f.c b/sim/cris/crisv32f.c
index 1e4a4fa48e..656be733b4 100644
--- a/sim/cris/crisv32f.c
+++ b/sim/cris/crisv32f.c
@@ -19,6 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* The infrastructure is based on that of i960.c. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_CRISV32F
#define SPECIFIC_U_EXEC_FN
diff --git a/sim/cris/dv-cris.c b/sim/cris/dv-cris.c
index 1bb89e48f7..b4251d0b5e 100644
--- a/sim/cris/dv-cris.c
+++ b/sim/cris/dv-cris.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/cris/dv-cris_900000xx.c b/sim/cris/dv-cris_900000xx.c
index c6afe020c8..5cecdc7b0a 100644
--- a/sim/cris/dv-cris_900000xx.c
+++ b/sim/cris/dv-cris_900000xx.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/cris/dv-rv.c b/sim/cris/dv-rv.c
index cef164b098..310155c844 100644
--- a/sim/cris/dv-rv.c
+++ b/sim/cris/dv-rv.c
@@ -18,6 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/cris/rvdummy.c b/sim/cris/rvdummy.c
index 788f8edb50..b53e823f8f 100644
--- a/sim/cris/rvdummy.c
+++ b/sim/cris/rvdummy.c
@@ -29,9 +29,8 @@ main (int argc, char *argv[])
}
#else
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* This must come before any other includes. */
+#include "defs.h"
#include "getopt.h"
#include "libiberty.h"
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 388d1ef896..15a4018b5b 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -20,7 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Based on the fr30 file, mixing in bits from the i960 and pruning of
dead code. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "libiberty.h"
#include "bfd.h"
#include "elf-bfd.h"
diff --git a/sim/cris/traps.c b/sim/cris/traps.c
index 483747fb4e..99344a283d 100644
--- a/sim/cris/traps.c
+++ b/sim/cris/traps.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-syscall.h"
#include "sim-options.h"
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index 622a9111ec..bce1617d90 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * d10v_sim.h, gencode.c: Delete config.h include.
+ * endian.c: Include defs.h.
+ * interp.c, simops.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/d10v/d10v_sim.h b/sim/d10v/d10v_sim.h
index 972402cc4d..1e1e84c76a 100644
--- a/sim/d10v/d10v_sim.h
+++ b/sim/d10v/d10v_sim.h
@@ -1,4 +1,3 @@
-#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
diff --git a/sim/d10v/endian.c b/sim/d10v/endian.c
index dbc3db2003..70f63d8e54 100644
--- a/sim/d10v/endian.c
+++ b/sim/d10v/endian.c
@@ -1,6 +1,9 @@
/* If we're being compiled as a .c file, rather than being included in
d10v_sim.h, then ENDIAN_INLINE won't be defined yet. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#ifndef ENDIAN_INLINE
#define NO_ENDIAN_INLINE
#include "sim-main.h"
diff --git a/sim/d10v/gencode.c b/sim/d10v/gencode.c
index 9f8a41c936..6e006d089a 100644
--- a/sim/d10v/gencode.c
+++ b/sim/d10v/gencode.c
@@ -1,4 +1,3 @@
-#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index a0dc2f5968..b56b204c72 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -1,4 +1,6 @@
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <inttypes.h>
#include <signal.h>
#include "bfd.h"
diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c
index ed0c8a3625..af725ad9bb 100644
--- a/sim/d10v/simops.c
+++ b/sim/d10v/simops.c
@@ -1,4 +1,5 @@
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <signal.h>
#include <errno.h>
diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog
index 40dd931079..355880e22a 100644
--- a/sim/erc32/ChangeLog
+++ b/sim/erc32/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * erc32.c, exec.c, float.c, func.c, help.c, interf.c, sis.c: Replace
+ config.h include with defs.h.
+ * sis.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c
index a93b62b798..747ac780b8 100644
--- a/sim/erc32/erc32.c
+++ b/sim/erc32/erc32.c
@@ -18,7 +18,9 @@
/* The control space devices */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
diff --git a/sim/erc32/exec.c b/sim/erc32/exec.c
index 8daf759514..d8a8c6c662 100644
--- a/sim/erc32/exec.c
+++ b/sim/erc32/exec.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sis.h"
#include <math.h>
#include <stdio.h>
diff --git a/sim/erc32/float.c b/sim/erc32/float.c
index 6d3d2bd73d..d2ae39785a 100644
--- a/sim/erc32/float.c
+++ b/sim/erc32/float.c
@@ -26,7 +26,9 @@
4. Clear host exception bits.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sis.h"
#include <fenv.h>
diff --git a/sim/erc32/func.c b/sim/erc32/func.c
index 52428e4835..ff53f3bca5 100644
--- a/sim/erc32/func.c
+++ b/sim/erc32/func.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <string.h>
#include <stdio.h>
diff --git a/sim/erc32/help.c b/sim/erc32/help.c
index 419ab0d33e..211de52f53 100644
--- a/sim/erc32/help.c
+++ b/sim/erc32/help.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include "sis.h"
diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c
index c199dabea3..28c981bbb9 100644
--- a/sim/erc32/interf.c
+++ b/sim/erc32/interf.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <string.h>
#include <stdio.h>
diff --git a/sim/erc32/sis.c b/sim/erc32/sis.c
index 05044c3ad8..749d25620b 100644
--- a/sim/erc32/sis.c
+++ b/sim/erc32/sis.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <string.h>
#include <stdlib.h>
diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h
index 10c500f820..7f787cf143 100644
--- a/sim/erc32/sis.h
+++ b/sim/erc32/sis.h
@@ -13,7 +13,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
#include "ansidecl.h"
#include "sim/callback.h"
#include "sim/sim.h"
diff --git a/sim/example-synacor/ChangeLog b/sim/example-synacor/ChangeLog
index 0f91ff2727..ddd56b2ea8 100644
--- a/sim/example-synacor/ChangeLog
+++ b/sim/example-synacor/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c, sim-main.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/example-synacor/interp.c b/sim/example-synacor/interp.c
index e613e16782..eaf8f1fdf9 100644
--- a/sim/example-synacor/interp.c
+++ b/sim/example-synacor/interp.c
@@ -25,7 +25,8 @@
For more specific details on these functions, see the sim/sim.h header
file. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-options.h"
diff --git a/sim/example-synacor/sim-main.c b/sim/example-synacor/sim-main.c
index a7d748f302..d7a68b38bf 100644
--- a/sim/example-synacor/sim-main.c
+++ b/sim/example-synacor/sim-main.c
@@ -21,7 +21,8 @@
/* This file contains the main simulator decoding logic. i.e. everything that
is architecture specific. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 6b93dd8c68..e9e94631af 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * cache.c, frv.c, interrupts.c, memory.c, options.c, pipeline.c,
+ profile-fr400.c, profile-fr450.c, profile-fr500.c, profile-fr550.c,
+ profile.c, registers.c, reset.c, sim-if.c, traps.c: Include defs.h.
+ * sim-main.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/frv/cache.c b/sim/frv/cache.c
index c10d46373f..e569d5239d 100644
--- a/sim/frv/cache.c
+++ b/sim/frv/cache.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/frv/frv.c b/sim/frv/frv.c
index fee59c2aae..aff9dc1a49 100644
--- a/sim/frv/frv.c
+++ b/sim/frv/frv.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/interrupts.c b/sim/frv/interrupts.c
index 0b8ed76398..a657c68e24 100644
--- a/sim/frv/interrupts.c
+++ b/sim/frv/interrupts.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/frv/memory.c b/sim/frv/memory.c
index 5978d15162..681fea49c8 100644
--- a/sim/frv/memory.c
+++ b/sim/frv/memory.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/frv/options.c b/sim/frv/options.c
index b5cc8dec79..3528c357c6 100644
--- a/sim/frv/options.c
+++ b/sim/frv/options.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/frv/pipeline.c b/sim/frv/pipeline.c
index 564a33b9fc..f8a5ba4426 100644
--- a/sim/frv/pipeline.c
+++ b/sim/frv/pipeline.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/frv/profile-fr400.c b/sim/frv/profile-fr400.c
index 06cf4316af..f6752d88c1 100644
--- a/sim/frv/profile-fr400.c
+++ b/sim/frv/profile-fr400.c
@@ -16,9 +16,11 @@ 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 <http://www.gnu.org/licenses/>.
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This must come before any other includes. */
+#include "defs.h"
-*/
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/profile-fr450.c b/sim/frv/profile-fr450.c
index 0e8b01bc59..8e4f06ba3e 100644
--- a/sim/frv/profile-fr450.c
+++ b/sim/frv/profile-fr450.c
@@ -16,9 +16,11 @@ 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 <http://www.gnu.org/licenses/>.
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This must come before any other includes. */
+#include "defs.h"
-*/
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/profile-fr500.c b/sim/frv/profile-fr500.c
index 32d7f85faf..41ee067c97 100644
--- a/sim/frv/profile-fr500.c
+++ b/sim/frv/profile-fr500.c
@@ -16,9 +16,11 @@ 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 <http://www.gnu.org/licenses/>.
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This must come before any other includes. */
+#include "defs.h"
-*/
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/profile-fr550.c b/sim/frv/profile-fr550.c
index 94837a753b..af42d37a17 100644
--- a/sim/frv/profile-fr550.c
+++ b/sim/frv/profile-fr550.c
@@ -16,9 +16,11 @@ 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 <http://www.gnu.org/licenses/>.
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This must come before any other includes. */
+#include "defs.h"
-*/
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/profile.c b/sim/frv/profile.c
index 441590eb58..0d2b6f40c4 100644
--- a/sim/frv/profile.c
+++ b/sim/frv/profile.c
@@ -16,9 +16,11 @@ 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 <http://www.gnu.org/licenses/>.
+along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This must come before any other includes. */
+#include "defs.h"
-*/
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/registers.c b/sim/frv/registers.c
index 764a6755b3..8a92038fd5 100644
--- a/sim/frv/registers.c
+++ b/sim/frv/registers.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/reset.c b/sim/frv/reset.c
index 4cae7997e3..c87b99f2a9 100644
--- a/sim/frv/reset.c
+++ b/sim/frv/reset.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#define WANT_CPU_FRVBF
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 65e2937536..c5fd93f0b3 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#define WANT_CPU_FRVBF
#include "sim-main.h"
diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h
index 25a0e566dc..1515c325e7 100644
--- a/sim/frv/sim-main.h
+++ b/sim/frv/sim-main.h
@@ -19,10 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Main header for the frv. */
-/* sim-basics.h includes config.h but cgen-types.h must be included before
- sim-basics.h and cgen-types.h needs config.h. */
-#include "config.h"
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. ???? */
diff --git a/sim/frv/traps.c b/sim/frv/traps.c
index 5e6a4d06ef..25b4e3eea2 100644
--- a/sim/frv/traps.c
+++ b/sim/frv/traps.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU frvbf
#define WANT_CPU_FRVBF
diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog
index 08a5b9bb33..819625ef0e 100644
--- a/sim/ft32/ChangeLog
+++ b/sim/ft32/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 6120df179b..5fc9ea2465 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -18,7 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index b53309a027..dfbaecb5da 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * compile.c: Replace config.h include with defs.h.
+ * sim-main.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-08 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 365f8667c6..2ac6dd0bf7 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -17,7 +17,9 @@
* AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <time.h>
#include <stdlib.h>
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index b6169b3bc1..68e44ae933 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -1,6 +1,5 @@
/* Main header for the Hitachi h8/300 architecture. */
-#include "config.h"
#include "bfd.h"
#ifndef SIM_MAIN_H
diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog
index 1f90b573cf..b21e075d71 100644
--- a/sim/iq2000/ChangeLog
+++ b/sim/iq2000/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * iq2000.c, sim-if.c: Include defs.h.
+ * sim-main.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Tom Tromey <tromey@adacore.com>
diff --git a/sim/iq2000/iq2000.c b/sim/iq2000/iq2000.c
index 66d7b47dfb..018c6a63a3 100644
--- a/sim/iq2000/iq2000.c
+++ b/sim/iq2000/iq2000.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU
#define WANT_CPU_IQ2000BF
diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c
index 4db2e4d9b0..b363eb04a2 100644
--- a/sim/iq2000/sim-if.c
+++ b/sim/iq2000/sim-if.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <stdlib.h>
diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h
index 829f9bb56b..d0ae1cfef7 100644
--- a/sim/iq2000/sim-main.h
+++ b/sim/iq2000/sim-main.h
@@ -4,10 +4,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-/* sim-basics.h includes config.h but cgen-types.h must be included before
- sim-basics.h and cgen-types.h needs config.h. */
-#include "config.h"
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. ???? */
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog
index 90613411a5..db0e8f0c8a 100644
--- a/sim/lm32/ChangeLog
+++ b/sim/lm32/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * dv-lm32cpu.c, dv-lm32timer.c, dv-lm32uart.c, lm32.c, sim-if.c,
+ traps.c, user.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Tom Tromey <tromey@adacore.com>
diff --git a/sim/lm32/dv-lm32cpu.c b/sim/lm32/dv-lm32cpu.c
index 2ef32c7e6e..2f702bd722 100644
--- a/sim/lm32/dv-lm32cpu.c
+++ b/sim/lm32/dv-lm32cpu.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "hw-main.h"
#include "sim-main.h"
diff --git a/sim/lm32/dv-lm32timer.c b/sim/lm32/dv-lm32timer.c
index 801d27d42f..a04afc1d34 100644
--- a/sim/lm32/dv-lm32timer.c
+++ b/sim/lm32/dv-lm32timer.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
#include "sim-assert.h"
diff --git a/sim/lm32/dv-lm32uart.c b/sim/lm32/dv-lm32uart.c
index c840b1796b..1f8ba1d92e 100644
--- a/sim/lm32/dv-lm32uart.c
+++ b/sim/lm32/dv-lm32uart.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
#include "sim-assert.h"
diff --git a/sim/lm32/lm32.c b/sim/lm32/lm32.c
index 3c68eafb05..2ffe48de1b 100644
--- a/sim/lm32/lm32.c
+++ b/sim/lm32/lm32.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU lm32bf
#define WANT_CPU_LM32BF
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index c97a45129d..1cccf626b6 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
diff --git a/sim/lm32/traps.c b/sim/lm32/traps.c
index 75b8ee7251..5b010f9d3f 100644
--- a/sim/lm32/traps.c
+++ b/sim/lm32/traps.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU lm32bf
#define WANT_CPU_LM32BF
diff --git a/sim/lm32/user.c b/sim/lm32/user.c
index d84075a03f..1e7bb71515 100644
--- a/sim/lm32/user.c
+++ b/sim/lm32/user.c
@@ -18,6 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
/* Handle user defined instructions. */
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index af71d21bbf..591d8b9ddd 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * int.c, misc.c, opc2c.c, reg.c, srcdest.c: Include defs.h.
+ * gdb-if.c, load.c, main.c, mem.c, syscalls.c, trace.c: Replace
+ config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index 3698648767..b00d878f0b 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <assert.h>
#include <signal.h>
diff --git a/sim/m32c/int.c b/sim/m32c/int.c
index ffc96ae5dd..4275399683 100644
--- a/sim/m32c/int.c
+++ b/sim/m32c/int.c
@@ -18,6 +18,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "int.h"
#include "cpu.h"
diff --git a/sim/m32c/load.c b/sim/m32c/load.c
index 86e774e3ab..277fc14149 100644
--- a/sim/m32c/load.c
+++ b/sim/m32c/load.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/sim/m32c/main.c b/sim/m32c/main.c
index ac36bc5707..4c2c255ecd 100644
--- a/sim/m32c/main.c
+++ b/sim/m32c/main.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/sim/m32c/mem.c b/sim/m32c/mem.c
index 4baf71fa67..243b7c4e07 100644
--- a/sim/m32c/mem.c
+++ b/sim/m32c/mem.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/m32c/misc.c b/sim/m32c/misc.c
index 50692e5ac7..5e09885be6 100644
--- a/sim/m32c/misc.c
+++ b/sim/m32c/misc.c
@@ -18,6 +18,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
diff --git a/sim/m32c/opc2c.c b/sim/m32c/opc2c.c
index 4c97644943..3d1713d203 100644
--- a/sim/m32c/opc2c.c
+++ b/sim/m32c/opc2c.c
@@ -18,6 +18,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <string.h>
diff --git a/sim/m32c/reg.c b/sim/m32c/reg.c
index 1b3c774cf8..a57b6a11c6 100644
--- a/sim/m32c/reg.c
+++ b/sim/m32c/reg.c
@@ -18,6 +18,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/m32c/srcdest.c b/sim/m32c/srcdest.c
index d5feb1716f..f3040c571e 100644
--- a/sim/m32c/srcdest.c
+++ b/sim/m32c/srcdest.c
@@ -18,6 +18,8 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/m32c/syscalls.c b/sim/m32c/syscalls.c
index e9400840be..e8d9d2e6cc 100644
--- a/sim/m32c/syscalls.c
+++ b/sim/m32c/syscalls.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
diff --git a/sim/m32c/trace.c b/sim/m32c/trace.c
index f871c01d82..d16be4c8d9 100644
--- a/sim/m32c/trace.c
+++ b/sim/m32c/trace.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index 04031e7f90..2e099a07fe 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * dv-m32r_cache.c, dv-m32r_uart.c: Replace config.h include with
+ defs.h.
+ * m32r.c, m32r2.c, m32rx.c, sim-if.c, traps-linux.c,
+ traps.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Tom Tromey <tromey@adacore.com>
diff --git a/sim/m32r/dv-m32r_cache.c b/sim/m32r/dv-m32r_cache.c
index 44e2537dc6..bb63b3d6b2 100644
--- a/sim/m32r/dv-m32r_cache.c
+++ b/sim/m32r/dv-m32r_cache.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m32r/dv-m32r_uart.c b/sim/m32r/dv-m32r_uart.c
index e4b091203e..c6b529d935 100644
--- a/sim/m32r/dv-m32r_uart.c
+++ b/sim/m32r/dv-m32r_uart.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m32r/m32r.c b/sim/m32r/m32r.c
index 1d0a7356bb..3f8305ecd5 100644
--- a/sim/m32r/m32r.c
+++ b/sim/m32r/m32r.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU m32rbf
#define WANT_CPU_M32RBF
diff --git a/sim/m32r/m32r2.c b/sim/m32r/m32r2.c
index b4346cf6cb..852c10814c 100644
--- a/sim/m32r/m32r2.c
+++ b/sim/m32r/m32r2.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU m32r2f
#define WANT_CPU_M32R2F
diff --git a/sim/m32r/m32rx.c b/sim/m32r/m32rx.c
index 31bcee1088..0e774bace7 100644
--- a/sim/m32r/m32rx.c
+++ b/sim/m32r/m32rx.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU m32rxf
#define WANT_CPU_M32RXF
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index 8d9f4324c9..a6d8c48616 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c
index 1ee1781f0e..63ed13788a 100644
--- a/sim/m32r/traps-linux.c
+++ b/sim/m32r/traps-linux.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-syscall.h"
#include "syscall.h"
diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c
index 9fca2b1ec1..ffa09f1527 100644
--- a/sim/m32r/traps.c
+++ b/sim/m32r/traps.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-syscall.h"
#include "targ-vals.h"
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 410660c55c..a070cdd528 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * dv-m68hc11.c, dv-m68hc11eepr.c, dv-m68hc11sio.c, dv-m68hc11spi.c,
+ dv-m68hc11tim.c, dv-nvram.c, emulos.c, gencode.c, interp.c,
+ interrupts.c, m68hc11_sim.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c
index f4815883a3..5b2d1ba0b5 100644
--- a/sim/m68hc11/dv-m68hc11.c
+++ b/sim/m68hc11/dv-m68hc11.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-hw.h"
diff --git a/sim/m68hc11/dv-m68hc11eepr.c b/sim/m68hc11/dv-m68hc11eepr.c
index 88bd121980..1e4cb5eab0 100644
--- a/sim/m68hc11/dv-m68hc11eepr.c
+++ b/sim/m68hc11/dv-m68hc11eepr.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c
index b6eacb4883..cf51d17f9f 100644
--- a/sim/m68hc11/dv-m68hc11sio.c
+++ b/sim/m68hc11/dv-m68hc11sio.c
@@ -20,6 +20,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m68hc11/dv-m68hc11spi.c b/sim/m68hc11/dv-m68hc11spi.c
index 1e9d56c849..6fe759d344 100644
--- a/sim/m68hc11/dv-m68hc11spi.c
+++ b/sim/m68hc11/dv-m68hc11spi.c
@@ -20,6 +20,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m68hc11/dv-m68hc11tim.c b/sim/m68hc11/dv-m68hc11tim.c
index d7bcac3fec..2c2e523da1 100644
--- a/sim/m68hc11/dv-m68hc11tim.c
+++ b/sim/m68hc11/dv-m68hc11tim.c
@@ -20,6 +20,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m68hc11/dv-nvram.c b/sim/m68hc11/dv-nvram.c
index 586ee2ff5f..88fab2f446 100644
--- a/sim/m68hc11/dv-nvram.c
+++ b/sim/m68hc11/dv-nvram.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/m68hc11/emulos.c b/sim/m68hc11/emulos.c
index 247e66871c..d7436f79b3 100644
--- a/sim/m68hc11/emulos.c
+++ b/sim/m68hc11/emulos.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/sim/m68hc11/gencode.c b/sim/m68hc11/gencode.c
index 2a2210d7ac..4681760679 100644
--- a/sim/m68hc11/gencode.c
+++ b/sim/m68hc11/gencode.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index 07e4a8858a..d4b2531abe 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-hw.h"
diff --git a/sim/m68hc11/interrupts.c b/sim/m68hc11/interrupts.c
index 03c78ac218..1adce50821 100644
--- a/sim/m68hc11/interrupts.c
+++ b/sim/m68hc11/interrupts.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
diff --git a/sim/m68hc11/m68hc11_sim.c b/sim/m68hc11/m68hc11_sim.c
index 0d7860170b..3c619c14ab 100644
--- a/sim/m68hc11/m68hc11_sim.c
+++ b/sim/m68hc11/m68hc11_sim.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-module.h"
diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog
index 3a14634057..7e70804621 100644
--- a/sim/mcore/ChangeLog
+++ b/sim/mcore/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index 5e8ad3b8a2..3517068abf 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog
index dce172193b..7b205acf09 100644
--- a/sim/microblaze/ChangeLog
+++ b/sim/microblaze/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 1b89bb4940..e451f2d68d 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -16,7 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 76134b7861..68c2503ec6 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+ * cp1.c, dsp.c, dv-tx3904cpu.c, dv-tx3904irc.c, dv-tx3904sio.c,
+ dv-tx3904tmr.c, m16run.c, mdmx.c, micromipsrun.c, sim-main.c:
+ Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index f5d3d1dd5f..03ed0c0558 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -40,6 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
(Originally, this code was in interp.c)
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <stdlib.h>
diff --git a/sim/mips/dsp.c b/sim/mips/dsp.c
index b82ff6880d..fb25caa835 100644
--- a/sim/mips/dsp.c
+++ b/sim/mips/dsp.c
@@ -17,6 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
int DSPLO_REGNUM[4] =
diff --git a/sim/mips/dv-tx3904cpu.c b/sim/mips/dv-tx3904cpu.c
index bf23a06685..43f38d2a7a 100644
--- a/sim/mips/dv-tx3904cpu.c
+++ b/sim/mips/dv-tx3904cpu.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904irc.c b/sim/mips/dv-tx3904irc.c
index d9a919752e..0896b0fabb 100644
--- a/sim/mips/dv-tx3904irc.c
+++ b/sim/mips/dv-tx3904irc.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904sio.c b/sim/mips/dv-tx3904sio.c
index 9676344bc3..c81b2dd3a5 100644
--- a/sim/mips/dv-tx3904sio.c
+++ b/sim/mips/dv-tx3904sio.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904tmr.c b/sim/mips/dv-tx3904tmr.c
index 48b169fd9b..5b5d8ac97f 100644
--- a/sim/mips/dv-tx3904tmr.c
+++ b/sim/mips/dv-tx3904tmr.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 49b79f91db..25eb497565 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -22,7 +22,9 @@ code on the hardware.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "bfd.h"
#include "sim-main.h"
#include "sim-utils.h"
@@ -32,9 +34,6 @@ code on the hardware.
#include "itable.h"
-
-#include "config.h"
-
#include <stdio.h>
#include <stdarg.h>
#include <ansidecl.h>
diff --git a/sim/mips/m16run.c b/sim/mips/m16run.c
index 44fb9e4538..a04e3eed3b 100644
--- a/sim/mips/m16run.c
+++ b/sim/mips/m16run.c
@@ -17,6 +17,9 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "m16_idecode.h"
#include "m32_idecode.h"
diff --git a/sim/mips/mdmx.c b/sim/mips/mdmx.c
index 948bb0d2eb..6978251a24 100644
--- a/sim/mips/mdmx.c
+++ b/sim/mips/mdmx.c
@@ -18,6 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include "sim-main.h"
diff --git a/sim/mips/micromipsrun.c b/sim/mips/micromipsrun.c
index 3950dc2faf..53a5c08118 100644
--- a/sim/mips/micromipsrun.c
+++ b/sim/mips/micromipsrun.c
@@ -19,6 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "micromips16_idecode.h"
#include "micromips32_idecode.h"
diff --git a/sim/mips/sim-main.c b/sim/mips/sim-main.c
index 620f4b2990..24e16029d2 100644
--- a/sim/mips/sim-main.c
+++ b/sim/mips/sim-main.c
@@ -19,6 +19,9 @@
#ifndef SIM_MAIN_C
#define SIM_MAIN_C
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 42eed82429..92dd6d1c34 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * dv-mn103cpu.c, dv-mn103int.c, dv-mn103iop.c, dv-mn103ser.c,
+ dv-mn103tim.c, op_utils.c: Include defs.h.
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mn10300/dv-mn103cpu.c b/sim/mn10300/dv-mn103cpu.c
index 3c3e843fa6..2a3591b8a3 100644
--- a/sim/mn10300/dv-mn103cpu.c
+++ b/sim/mn10300/dv-mn103cpu.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mn10300/dv-mn103int.c b/sim/mn10300/dv-mn103int.c
index cb81bc1152..2c47ca0e05 100644
--- a/sim/mn10300/dv-mn103int.c
+++ b/sim/mn10300/dv-mn103int.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mn10300/dv-mn103iop.c b/sim/mn10300/dv-mn103iop.c
index ecce7ec1fd..1fd8d178ba 100644
--- a/sim/mn10300/dv-mn103iop.c
+++ b/sim/mn10300/dv-mn103iop.c
@@ -18,6 +18,9 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mn10300/dv-mn103ser.c b/sim/mn10300/dv-mn103ser.c
index 8d9bf8fa4f..3465954f75 100644
--- a/sim/mn10300/dv-mn103ser.c
+++ b/sim/mn10300/dv-mn103ser.c
@@ -18,6 +18,9 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
#include "dv-sockser.h"
diff --git a/sim/mn10300/dv-mn103tim.c b/sim/mn10300/dv-mn103tim.c
index 61807c9932..ad9c24bbc6 100644
--- a/sim/mn10300/dv-mn103tim.c
+++ b/sim/mn10300/dv-mn103tim.c
@@ -18,6 +18,9 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "hw-main.h"
#include "sim-assert.h"
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 55e9e212fe..b6c5d5b087 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -1,4 +1,6 @@
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <signal.h>
#include "sim-main.h"
diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c
index 882ff46240..cd0f1a667e 100644
--- a/sim/mn10300/op_utils.c
+++ b/sim/mn10300/op_utils.c
@@ -1,3 +1,6 @@
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-syscall.h"
#include "targ-vals.h"
diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog
index be18085cda..39b19d3218 100644
--- a/sim/moxie/ChangeLog
+++ b/sim/moxie/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index 135716386f..caf9e43ded 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -17,7 +17,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog
index c6a4c65326..4664091de0 100644
--- a/sim/msp430/ChangeLog
+++ b/sim/msp430/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * msp430-sim.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index 4e213f978c..58a5469899 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -19,7 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog
index ddfa618113..af6afc4609 100644
--- a/sim/or1k/ChangeLog
+++ b/sim/or1k/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * sim-main.h: Delete config.h include.
+ * or1k.c, sim-if.c, traps.c: Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-12 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c
index 4b44e508b7..650d98b523 100644
--- a/sim/or1k/or1k.c
+++ b/sim/or1k/or1k.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_OR1K32BF
#define WANT_CPU
diff --git a/sim/or1k/sim-if.c b/sim/or1k/sim-if.c
index 41dbaaebf1..005124b9ad 100644
--- a/sim/or1k/sim-if.c
+++ b/sim/or1k/sim-if.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "libiberty.h"
diff --git a/sim/or1k/sim-main.h b/sim/or1k/sim-main.h
index cac1abb2b8..f91a351a2d 100644
--- a/sim/or1k/sim-main.h
+++ b/sim/or1k/sim-main.h
@@ -21,8 +21,6 @@
#define WITH_SCACHE_PBB 1
-#include "config.h"
-
#include "ansidecl.h"
#include "or1k-desc.h"
#include "sim-basics.h"
diff --git a/sim/or1k/traps.c b/sim/or1k/traps.c
index 0a0f1aa071..7f5a38f68b 100644
--- a/sim/or1k/traps.c
+++ b/sim/or1k/traps.c
@@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#define WANT_CPU_OR1K32BF
#define WANT_CPU
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 42db5f2685..0755fe288b 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,10 @@
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (gentmap): Pass -DUSE_CONFIG_H.
+ * basics.h, debug.c, filter_filename.c, inline.c, sim-endian.c,
+ words.h: Replace config.h include with defs.h.
+ * defs.h: New file.
+
2021-05-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (WERROR_CFLAGS): Define.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 9fc864e677..5ce511e96b 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -629,7 +629,7 @@ mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
# As a kludge, build the common stuff here for now.
gentmap: $(srcdir)/../common/gentmap.c Makefile targ-vals.def
$(LINK_FOR_BUILD) -I. -I../common -I$(srcdir)/../common \
- $(srcdir)/../common/gentmap.c
+ $(srcdir)/../common/gentmap.c -DUSE_CONFIG_H
targ-vals.def: $(srcdir)/../common/nltvals.def
rm -f targ-vals.def tmp-def
diff --git a/sim/ppc/basics.h b/sim/ppc/basics.h
index 2b923ea3cc..057cf1ab0e 100644
--- a/sim/ppc/basics.h
+++ b/sim/ppc/basics.h
@@ -21,6 +21,8 @@
#ifndef _BASICS_H_
#define _BASICS_H_
+/* This must come before any other includes. */
+#include "defs.h"
/* from Michael Meissner, macro's to handle concating symbols better */
@@ -85,7 +87,6 @@ typedef enum {
/* Basic configuration */
-#include "config.h"
#include "ppc-config.h"
#include "inline.h"
diff --git a/sim/ppc/debug.c b/sim/ppc/debug.c
index dba1425536..53a392a303 100644
--- a/sim/ppc/debug.c
+++ b/sim/ppc/debug.c
@@ -21,7 +21,9 @@
#ifndef _DEBUG_C_
#define _DEBUG_C_
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "basics.h"
#include <stdlib.h>
diff --git a/sim/ppc/defs.h b/sim/ppc/defs.h
new file mode 100644
index 0000000000..66e76d26db
--- /dev/null
+++ b/sim/ppc/defs.h
@@ -0,0 +1,26 @@
+/* The configure generated header settings.
+
+ Copyright 2002-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 of the License, 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 <http://www.gnu.org/licenses/>. */
+
+/* This file should be included by every .c file before any other header. */
+
+#ifndef DEFS_H
+#define DEFS_H
+
+/* Include sim's various configure tests. */
+#include "config.h"
+
+#endif
diff --git a/sim/ppc/filter_filename.c b/sim/ppc/filter_filename.c
index 2457b68790..b59ca21ca5 100644
--- a/sim/ppc/filter_filename.c
+++ b/sim/ppc/filter_filename.c
@@ -17,7 +17,9 @@
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ppc-config.h"
#include "filter_filename.h"
diff --git a/sim/ppc/inline.c b/sim/ppc/inline.c
index 8813169c60..1db2dec5c3 100644
--- a/sim/ppc/inline.c
+++ b/sim/ppc/inline.c
@@ -21,7 +21,9 @@
#ifndef _INLINE_C_
#define _INLINE_C_
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "ppc-config.h"
#include "inline.h"
diff --git a/sim/ppc/sim-endian.c b/sim/ppc/sim-endian.c
index 1ffa2d7e4e..2625d80d0b 100644
--- a/sim/ppc/sim-endian.c
+++ b/sim/ppc/sim-endian.c
@@ -21,7 +21,9 @@
#ifndef _SIM_ENDIAN_C_
#define _SIM_ENDIAN_C_
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "basics.h"
diff --git a/sim/ppc/words.h b/sim/ppc/words.h
index 7645349ac5..641f22514e 100644
--- a/sim/ppc/words.h
+++ b/sim/ppc/words.h
@@ -43,9 +43,8 @@
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* This must come before any other includes. */
+#include "defs.h"
/* bit based */
typedef char natural8;
diff --git a/sim/pru/ChangeLog b/sim/pru/ChangeLog
index 7b6aac181a..0fef8ffbc7 100644
--- a/sim/pru/ChangeLog
+++ b/sim/pru/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+ * pru.h, sim-main.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/pru/interp.c b/sim/pru/interp.c
index 6398c6714f..58ac333c1e 100644
--- a/sim/pru/interp.c
+++ b/sim/pru/interp.c
@@ -18,7 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
diff --git a/sim/pru/pru.h b/sim/pru/pru.h
index c2b631cda6..17febb295b 100644
--- a/sim/pru/pru.h
+++ b/sim/pru/pru.h
@@ -19,7 +19,6 @@
#ifndef PRU_H
#define PRU_H
-#include "config.h"
#include "opcode/pru.h"
/* Needed for handling the dual PRU address space. */
diff --git a/sim/pru/sim-main.h b/sim/pru/sim-main.h
index 966cacf569..8233c20cef 100644
--- a/sim/pru/sim-main.h
+++ b/sim/pru/sim-main.h
@@ -19,8 +19,6 @@
#ifndef PRU_SIM_MAIN
#define PRU_SIM_MAIN
-#include "config.h"
-
#include <stdint.h>
#include <stddef.h>
#include "pru.h"
diff --git a/sim/riscv/ChangeLog b/sim/riscv/ChangeLog
index 9fe89f4527..53081dc0bb 100644
--- a/sim/riscv/ChangeLog
+++ b/sim/riscv/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c, machs.c, sim-main.c: Replace config.h include with defs.h.
+
2021-05-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.c (mulhu): Change check to HAVE___INT128.
diff --git a/sim/riscv/interp.c b/sim/riscv/interp.c
index 6192b6dc5b..d430d77d70 100644
--- a/sim/riscv/interp.c
+++ b/sim/riscv/interp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-options.h"
diff --git a/sim/riscv/machs.c b/sim/riscv/machs.c
index 853a3afb42..9ff2303367 100644
--- a/sim/riscv/machs.c
+++ b/sim/riscv/machs.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c
index bb45ffee57..7f87f1beb5 100644
--- a/sim/riscv/sim-main.c
+++ b/sim/riscv/sim-main.c
@@ -21,7 +21,8 @@
/* This file contains the main simulator decoding logic. i.e. everything that
is architecture specific. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <inttypes.h>
#include <time.h>
diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog
index 9fc92e1e04..ecd9ed0fc7 100644
--- a/sim/rl78/ChangeLog
+++ b/sim/rl78/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * cpu.c, gdb-if.c, load.c, main.c, mem.c, rl78.c, trace.c: Replace
+ config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c
index fde8afee96..1bd8b6ee38 100644
--- a/sim/rl78/cpu.c
+++ b/sim/rl78/cpu.c
@@ -19,7 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/sim/rl78/gdb-if.c b/sim/rl78/gdb-if.c
index 87e343cdd4..a2414f9a35 100644
--- a/sim/rl78/gdb-if.c
+++ b/sim/rl78/gdb-if.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <assert.h>
#include <signal.h>
diff --git a/sim/rl78/load.c b/sim/rl78/load.c
index c137ba6e40..a2a57b0b19 100644
--- a/sim/rl78/load.c
+++ b/sim/rl78/load.c
@@ -19,8 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rl78/main.c b/sim/rl78/main.c
index 8d8a79d5da..178fa75f79 100644
--- a/sim/rl78/main.c
+++ b/sim/rl78/main.c
@@ -19,8 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/sim/rl78/mem.c b/sim/rl78/mem.c
index 77e4987b6f..0b6ab8e79f 100644
--- a/sim/rl78/mem.c
+++ b/sim/rl78/mem.c
@@ -19,7 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rl78/rl78.c b/sim/rl78/rl78.c
index 006691c4c0..e45750ad7b 100644
--- a/sim/rl78/rl78.c
+++ b/sim/rl78/rl78.c
@@ -19,7 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rl78/trace.c b/sim/rl78/trace.c
index 6f897eb033..1b4b365af1 100644
--- a/sim/rl78/trace.c
+++ b/sim/rl78/trace.c
@@ -19,8 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index db00b6e5a5..dc30d46090 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -1,5 +1,11 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * err.c: Include defs.h.
+ * fpu.c, gdb-if.c, load.c, main.c, mem.c, misc.c, reg.c, rx.c,
+ syscalls.c, trace.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/rx/err.c b/sim/rx/err.c
index e72b6d3dde..c9b1c3cb57 100644
--- a/sim/rx/err.c
+++ b/sim/rx/err.c
@@ -18,6 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/rx/fpu.c b/sim/rx/fpu.c
index 6c4738c0b2..611d9123d4 100644
--- a/sim/rx/fpu.c
+++ b/sim/rx/fpu.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c
index 4a0f0701a5..7298631965 100644
--- a/sim/rx/gdb-if.c
+++ b/sim/rx/gdb-if.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <assert.h>
#include <signal.h>
diff --git a/sim/rx/load.c b/sim/rx/load.c
index b04826f55c..d144888027 100644
--- a/sim/rx/load.c
+++ b/sim/rx/load.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/sim/rx/main.c b/sim/rx/main.c
index 20a8434388..5d7092ba1d 100644
--- a/sim/rx/main.c
+++ b/sim/rx/main.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/sim/rx/mem.c b/sim/rx/mem.c
index 7e62bfb895..f9b9cc1a97 100644
--- a/sim/rx/mem.c
+++ b/sim/rx/mem.c
@@ -18,6 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
/* This slows down the simulator and we get some false negatives from
gcc, like when it uses a long-sized hole to hold a byte-sized
variable, knowing that it doesn't care about the other bits. But,
@@ -25,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
1. */
#define RDCHECK 0
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rx/misc.c b/sim/rx/misc.c
index 2a4a2539e4..e7447aca46 100644
--- a/sim/rx/misc.c
+++ b/sim/rx/misc.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include "cpu.h"
diff --git a/sim/rx/reg.c b/sim/rx/reg.c
index bdf2debac6..1d27c59bb9 100644
--- a/sim/rx/reg.c
+++ b/sim/rx/reg.c
@@ -18,8 +18,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rx/rx.c b/sim/rx/rx.c
index e3737a56e9..869dd3aa89 100644
--- a/sim/rx/rx.c
+++ b/sim/rx/rx.c
@@ -18,7 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sim/rx/syscalls.c b/sim/rx/syscalls.c
index 73ca0f2b19..1981b5d3c3 100644
--- a/sim/rx/syscalls.c
+++ b/sim/rx/syscalls.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
diff --git a/sim/rx/trace.c b/sim/rx/trace.c
index a005797b4e..bb191dbdd3 100644
--- a/sim/rx/trace.c
+++ b/sim/rx/trace.c
@@ -18,8 +18,9 @@ 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 <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
-#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index 4f687e8b52..3dc1630fc5 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,5 +1,9 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 5fb6aff02f..6524503577 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -18,7 +18,8 @@
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <ctype.h>
#include <stdio.h>
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 21706571e5..81120ed51c 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,5 +1,10 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c, simops.c: Include defs.h.
+ * sim-main.h: Delete config.h include.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-04 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index ff2f6a23e5..79c6e0f7dd 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -1,3 +1,6 @@
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "v850_sim.h"
diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h
index e7276a68f8..6556273f67 100644
--- a/sim/v850/sim-main.h
+++ b/sim/v850/sim-main.h
@@ -5,7 +5,6 @@
#define WITH_TARGET_WORD_MSB 31
-#include "config.h"
#include "sim-basics.h"
#include "sim-signal.h"
#include "sim-fpu.h"
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index bd23f92aba..62a2bbcbb6 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -1,3 +1,6 @@
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "v850_sim.h"
#include "simops.h"