[2/5] sim: move sim-inline to the common code

Message ID 20210619202721.10432-2-vapier@gentoo.org
State New
Headers show
Series
  • [1/5] sim: ppc: rename inline defines to match common code
Related show

Commit Message

Luis Machado via Gdb-patches June 19, 2021, 8:27 p.m.
This will allow us to build the common code with the same inline
settings as the arch subdirs, and only do the test once.
---
 sim/Makefile.am                |  4 +++-
 sim/Makefile.in                |  4 +++-
 sim/aarch64/aclocal.m4         |  1 -
 sim/aarch64/configure          | 35 ----------------------------
 sim/aclocal.m4                 |  1 +
 sim/arch-subdir.mk.in          |  2 ++
 sim/arm/aclocal.m4             |  1 -
 sim/arm/configure              | 35 ----------------------------
 sim/avr/aclocal.m4             |  1 -
 sim/avr/configure              | 35 ----------------------------
 sim/bfin/aclocal.m4            |  1 -
 sim/bfin/configure             | 35 ----------------------------
 sim/bpf/aclocal.m4             |  1 -
 sim/bpf/configure              | 35 ----------------------------
 sim/common/Make-common.in      |  3 +--
 sim/configure                  | 40 +++++++++++++++++++++++++++++---
 sim/configure.ac               |  1 +
 sim/cr16/aclocal.m4            |  1 -
 sim/cr16/configure             | 35 ----------------------------
 sim/cris/aclocal.m4            |  1 -
 sim/cris/configure             | 35 ----------------------------
 sim/d10v/aclocal.m4            |  1 -
 sim/d10v/configure             | 35 ----------------------------
 sim/erc32/aclocal.m4           |  1 -
 sim/erc32/configure            | 35 ----------------------------
 sim/example-synacor/aclocal.m4 |  1 -
 sim/example-synacor/configure  | 35 ----------------------------
 sim/frv/aclocal.m4             |  1 -
 sim/frv/configure              | 35 ----------------------------
 sim/ft32/aclocal.m4            |  1 -
 sim/ft32/configure             | 35 ----------------------------
 sim/h8300/aclocal.m4           |  1 -
 sim/h8300/configure            | 35 ----------------------------
 sim/iq2000/aclocal.m4          |  1 -
 sim/iq2000/configure           | 35 ----------------------------
 sim/lm32/aclocal.m4            |  1 -
 sim/lm32/configure             | 35 ----------------------------
 sim/m32c/aclocal.m4            |  1 -
 sim/m32c/configure             | 35 ----------------------------
 sim/m32r/aclocal.m4            |  1 -
 sim/m32r/configure             | 35 ----------------------------
 sim/m4/sim_ac_common.m4        |  2 --
 sim/m68hc11/aclocal.m4         |  1 -
 sim/m68hc11/configure          | 35 ----------------------------
 sim/mcore/aclocal.m4           |  1 -
 sim/mcore/configure            | 35 ----------------------------
 sim/microblaze/aclocal.m4      |  1 -
 sim/microblaze/configure       | 35 ----------------------------
 sim/mips/aclocal.m4            |  1 -
 sim/mips/configure             | 35 ----------------------------
 sim/mn10300/aclocal.m4         |  1 -
 sim/mn10300/configure          | 35 ----------------------------
 sim/moxie/aclocal.m4           |  1 -
 sim/moxie/configure            | 35 ----------------------------
 sim/msp430/aclocal.m4          |  1 -
 sim/msp430/configure           | 35 ----------------------------
 sim/or1k/aclocal.m4            |  1 -
 sim/or1k/configure             | 35 ----------------------------
 sim/ppc/Makefile.in            |  2 +-
 sim/ppc/configure              | 42 ----------------------------------
 sim/ppc/configure.ac           | 36 -----------------------------
 sim/pru/aclocal.m4             |  1 -
 sim/pru/configure              | 35 ----------------------------
 sim/riscv/aclocal.m4           |  1 -
 sim/riscv/configure            | 35 ----------------------------
 sim/rl78/aclocal.m4            |  1 -
 sim/rl78/configure             | 35 ----------------------------
 sim/rx/aclocal.m4              |  1 -
 sim/rx/configure               | 35 ----------------------------
 sim/sh/aclocal.m4              |  1 -
 sim/sh/configure               | 35 ----------------------------
 sim/v850/aclocal.m4            |  1 -
 sim/v850/configure             | 35 ----------------------------
 73 files changed, 49 insertions(+), 1204 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/Makefile.am b/sim/Makefile.am
index 8d5311456860..aa575798ab7e 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -36,7 +36,9 @@  DISTCLEANFILES =
 MOSTLYCLEANFILES = core
 
 AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
-AM_CPPFLAGS = -I$(srcroot)/include
+AM_CPPFLAGS = \
+	-I$(srcroot)/include \
+	$(sim_inline)
 
 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD)
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 8128a27971d7..a176cf97acf0 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -52,3 +52,5 @@  INTL_CFLAGS = @INCINTL@
 COMMON_LIBS = @LIBS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WERROR_CFLAGS = @WERROR_CFLAGS@
+
+sim_inline = @sim_inline@
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 80e45c761830..6d4f47d354b3 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -75,7 +75,6 @@  SIM_FLOAT = @sim_float@
 SIM_HW_CFLAGS = @sim_hw_cflags@
 SIM_HW_OBJS = @sim_hw_objs@
 SIM_HW = @sim_hw@
-SIM_INLINE = @sim_inline@
 SIM_RESERVED_BITS = @sim_reserved_bits@
 SIM_SCACHE = @sim_scache@
 SIM_WARN_CFLAGS = $(WARN_CFLAGS)
@@ -200,7 +199,7 @@  CONFIG_CFLAGS = \
 	$(SIM_BITSIZE) \
 	$(SIM_FLOAT) \
 	$(SIM_HW_CFLAGS) \
-	$(SIM_INLINE) \
+	$(sim_inline) \
 	$(SIM_RESERVED_BITS) \
 	$(SIM_SCACHE) \
 	$(SIM_WARN_CFLAGS) \
diff --git a/sim/configure.ac b/sim/configure.ac
index 33c7aca60f5a..a3f02a78e9a7 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -121,6 +121,7 @@  SIM_AC_OPTION_ASSERT
 SIM_AC_OPTION_DEBUG
 SIM_AC_OPTION_ENDIAN
 SIM_AC_OPTION_ENVIRONMENT
+SIM_AC_OPTION_INLINE
 SIM_AC_OPTION_PROFILE
 SIM_AC_OPTION_STDIO
 SIM_AC_OPTION_TRACE
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index 26d0eefdc35c..658789581471 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -24,6 +24,4 @@  AC_DEFUN([SIM_AC_COMMON],
 dnl We don't use automake, but we still want to support
 dnl --enable-maintainer-mode.
 AM_MAINTAINER_MODE
-
-SIM_AC_OPTION_INLINE
 ]) dnl End of SIM_AC_COMMON
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index a621e9940119..1c8a119c739f 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -58,7 +58,7 @@  SHELL = /bin/sh
 BISON = bison
 MAKEINFO = makeinfo
 
-INLINE_CFLAGS = @sim_inline@
+INLINE_CFLAGS = $(sim_inline)
 SMP_CFLAGS = @sim_smp@
 XOR_ENDIAN_CFLAGS = @sim_xor_endian@
 BITSIZE_CFLAGS = @sim_bitsize@
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 19dbd77bda91..30952f30a4af 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -269,41 +269,6 @@  if test x"$silent" != x"yes"; then
 fi])dnl
 
 
-AC_ARG_ENABLE(sim-inline,
-[  --enable-sim-inline=inlines		Specify which functions should be inlined.],
-[sim_inline=""
-case "$enableval" in
-  no)		sim_inline="-DDEFAULT_INLINE=0";;
-  0)		sim_inline="-DDEFAULT_INLINE=0";;
-  yes | 2)	sim_inline="-DDEFAULT_INLINE=ALL_C_INLINE";;
-  1)		sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
-  *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
-       new_flag=""
-       case "$x" in
-	 *_INLINE=*)	new_flag="-D$x";;
-	 *=*)		new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
-	 *_INLINE)	new_flag="-D$x=ALL_C_INLINE";;
-	 *)		new_flag="-D$x""_INLINE=ALL_C_INLINE";;
-       esac
-       if test x"$sim_inline" = x""; then
-	 sim_inline="$new_flag"
-       else
-	 sim_inline="$sim_inline $new_flag"
-       fi
-     done;;
-esac
-if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
-  echo "Setting inline flags = $sim_inline" 6>&1
-fi],[if test x"$GCC" != ""; then
-  sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
-  if test x"$silent" != x"yes"; then
-    echo "Setting inline flags = $sim_inline" 6>&1
-  fi
-else
-  sim_inline=""
-fi])dnl
-
-
 AC_ARG_ENABLE(sim-jump,
 [  --enable-sim-jump		Jump between semantic code (instead of call/return).],
 [case "${enableval}" in
@@ -693,7 +658,6 @@  AC_SUBST(sim_hw_src)
 AC_SUBST(sim_hw_obj)
 AC_SUBST(sim_pk_src)
 AC_SUBST(sim_pk_obj)
-AC_SUBST(sim_inline)
 AC_SUBST(sim_xor_endian)
 AC_SUBST(sim_smp)
 AC_SUBST(sim_igen_smp)