public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/submitted 01/10] sim: ppc: move long long test to top-level
@ 2024-01-02  5:36 Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

While the sim code doesn't utilize HAVE_LONG_LONG itself, other code
(like libiberty) seem to, so check for it in the top-level for all
ports to leverage.
---
 sim/config.h.in           |   3 +
 sim/configure             |  14 +-
 sim/m4/sim_ac_platform.m4 |   1 +
 sim/ppc/config.in         |  33 --
 sim/ppc/configure         | 618 +-------------------------------------
 sim/ppc/configure.ac      |   2 -
 6 files changed, 18 insertions(+), 653 deletions(-)

diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index dcab5b2862d9..1914f61f8101 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -132,6 +132,7 @@ AC_CHECK_TYPES(socklen_t, [], [],
 [#include <sys/types.h>
 #include <sys/socket.h>
 ])
+AC_CHECK_TYPES([long long])
 
 dnl Some System V related checks.
 AC_CACHE_CHECK([if union semun defined],
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 06be2c960768..9c2d64b4c66b 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -382,8 +382,6 @@ if test $ac_cv_struct_statfs = yes; then
 	    [Define if struct statfs is defined in <sys/mount.h>])
 fi
 
-AC_CHECK_TYPES(long long)
-
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_opcode)
 AC_SUBST(sim_switch)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 02/10] sim: ppc: move struct statfs to top-level
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h Mike Frysinger
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

---
 sim/config.h.in           |  3 +++
 sim/configure             | 51 +++++++++++++++++++++++++++++++++++++--
 sim/m4/sim_ac_platform.m4 | 24 ++++++++++++++++++
 sim/ppc/config.in         |  3 ---
 sim/ppc/configure         | 44 ---------------------------------
 sim/ppc/configure.ac      | 24 ------------------
 6 files changed, 76 insertions(+), 73 deletions(-)

diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index 1914f61f8101..6f3e48f63dd2 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -134,6 +134,30 @@ AC_CHECK_TYPES(socklen_t, [], [],
 ])
 AC_CHECK_TYPES([long long])
 
+dnl Check for struct statfs.
+AC_CACHE_CHECK([for struct statfs],
+  [sim_cv_struct_statfs],
+  [AC_TRY_COMPILE([
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif], [
+  struct statfs s;
+], [sim_cv_struct_statfs="yes"], [sim_cv_struct_statfs="no"])])
+AS_IF([test x"sim_cv_struct_statfs" = x"yes"], [dnl
+  AC_DEFINE(HAVE_STRUCT_STATFS, 1,
+	    [Define if struct statfs is defined in <sys/mount.h>])
+])
+
 dnl Some System V related checks.
 AC_CACHE_CHECK([if union semun defined],
   [sim_cv_has_union_semun],
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 9c2d64b4c66b..13db9fc4791e 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -358,30 +358,6 @@ else
   ac_cv_termio_cline=no
 fi
 
-dnl Check for struct statfs
-AC_MSG_CHECKING(for struct statfs)
-AC_CACHE_VAL(ac_cv_struct_statfs,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif],
-[static struct statfs s;],
-ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
-AC_MSG_RESULT($ac_cv_struct_statfs)
-if test $ac_cv_struct_statfs = yes; then
-  AC_DEFINE(HAVE_STRUCT_STATFS, 1,
-	    [Define if struct statfs is defined in <sys/mount.h>])
-fi
-
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_opcode)
 AC_SUBST(sim_switch)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER Mike Frysinger
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

Move the defines from explicit -D options to config.h defines to simplify
the build and make it easier to move to the top-level configure.
---
 sim/ppc/Makefile.in  |  2 --
 sim/ppc/config.in    | 12 ++++++++++++
 sim/ppc/configure    | 19 ++++++++++++-------
 sim/ppc/configure.ac | 10 ++++------
 4 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 26a1e7cfd28e..8eaad7424c44 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -68,7 +68,6 @@ TIMEBASE_CFLAGS = @sim_timebase@
 FLOAT_CFLAGS = @sim_float@
 MONITOR_CFLAGS = @sim_monitor@
 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
-TERMIO_CFLAGS = @sim_termio@
 SWITCH_CFLAGS = @sim_switch@
 CONFIG_CFLAGS = \
   $(SMP_CFLAGS) \
@@ -78,7 +77,6 @@ CONFIG_CFLAGS = \
   $(FLOAT_CFLAGS) \
   $(MONITOR_CFLAGS) \
   $(MODEL_CFLAGS) \
-  $(TERMIO_CFLAGS) \
   $(SWITCH_CFLAGS)
 SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
 
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 13db9fc4791e..e8354791a711 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -289,7 +289,6 @@ AC_CONFIG_HEADER(config.h:config.in)
 
 
 dnl Figure out what type of termio/termios support there is
-sim_termio=""
 AC_MSG_CHECKING(for struct termios)
 AC_CACHE_VAL(ac_cv_termios_struct,
 [AC_TRY_COMPILE([#include <sys/types.h>
@@ -303,7 +302,7 @@ AC_CACHE_VAL(ac_cv_termios_struct,
 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
 AC_MSG_RESULT($ac_cv_termios_struct)
 if test $ac_cv_termios_struct = yes; then
-  sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
+  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
 fi
 
 if test "$ac_cv_termios_struct" = "yes"; then
@@ -316,7 +315,7 @@ if test "$ac_cv_termios_struct" = "yes"; then
 
   AC_MSG_RESULT($ac_cv_termios_cline)
   if test $ac_cv_termios_cline = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
+    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
   fi
 else
   ac_cv_termios_cline=no
@@ -336,7 +335,7 @@ if test "$ac_cv_termios_struct" != "yes"; then
 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
   AC_MSG_RESULT($ac_cv_termio_struct)
   if test $ac_cv_termio_struct = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
+    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
   fi
 else
   ac_cv_termio_struct=no
@@ -352,7 +351,7 @@ if test "$ac_cv_termio_struct" = "yes"; then
 
   AC_MSG_RESULT($ac_cv_termio_cline)
   if test $ac_cv_termio_cline = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
+    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
   fi
 else
   ac_cv_termio_cline=no
@@ -378,7 +377,6 @@ AC_SUBST(sim_monitor)
 AC_SUBST(sim_model)
 AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
-AC_SUBST(sim_termio)
 
 AC_OUTPUT(Makefile,
 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK Mike Frysinger
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

This covers a lot of the AC_MSG_CHECKING+AC_TRY_COMPILE+AC_MSG_RESULT
boilerplate and matches what we do in the top-level platform checks.
---
 sim/ppc/configure    | 127 +++++++++++++++++++++++++++----------------
 sim/ppc/configure.ac |  40 +++++++-------
 2 files changed, 99 insertions(+), 68 deletions(-)

diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index e8354791a711..8810ff2f4726 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -306,19 +306,19 @@ if test $ac_cv_termios_struct = yes; then
 fi
 
 if test "$ac_cv_termios_struct" = "yes"; then
-  AC_MSG_CHECKING(for c_line field in struct termios)
-  AC_CACHE_VAL(ac_cv_termios_cline,
-  [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/termios.h>],
-[static struct termios x; x.c_line = 0;],
-  ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
-
-  AC_MSG_RESULT($ac_cv_termios_cline)
-  if test $ac_cv_termios_cline = yes; then
+  AC_CACHE_VAL([sim_cv_termios_cline])
+  AC_CHECK_MEMBER(
+    [struct termios.c_line],
+    [sim_cv_termios_cline="yes"],
+    [sim_cv_termios_cline="no"], [
+#include <sys/types.h>
+#include <sys/termios.h>
+])
+  if test $sim_cv_termios_cline = yes; then
     AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
   fi
 else
-  ac_cv_termios_cline=no
+  sim_cv_termios_cline=no
 fi
 
 if test "$ac_cv_termios_struct" != "yes"; then
@@ -342,19 +342,19 @@ else
 fi
 
 if test "$ac_cv_termio_struct" = "yes"; then
-  AC_MSG_CHECKING(for c_line field in struct termio)
-  AC_CACHE_VAL(ac_cv_termio_cline,
-  [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/termio.h>],
-[static struct termio x; x.c_line = 0;],
-  ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
-
-  AC_MSG_RESULT($ac_cv_termio_cline)
-  if test $ac_cv_termio_cline = yes; then
+  AC_CACHE_VAL([sim_cv_termio_cline])
+  AC_CHECK_MEMBER(
+    [struct termio.c_line],
+    [sim_cv_termio_cline="yes"],
+    [sim_cv_termio_cline="no"], [
+#include <sys/types.h>
+#include <sys/termio.h>
+])
+  if test $sim_cv_termio_cline = yes; then
     AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
   fi
 else
-  ac_cv_termio_cline=no
+  sim_cv_termio_cline=no
 fi
 
 AC_SUBST(sim_line_nr)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (2 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level Mike Frysinger
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT
which reduces the boilerplate in here a little bit.
---
 sim/ppc/configure    | 66 +++++++++++++++++++++++---------------------
 sim/ppc/configure.ac | 60 ++++++++++++++++++++--------------------
 2 files changed, 65 insertions(+), 61 deletions(-)

diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 8810ff2f4726..7b4b998e9487 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -289,23 +289,23 @@ AC_CONFIG_HEADER(config.h:config.in)
 
 
 dnl Figure out what type of termio/termios support there is
-AC_MSG_CHECKING(for struct termios)
-AC_CACHE_VAL(ac_cv_termios_struct,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/termios.h>],
-[static struct termios x;
- x.c_iflag = 0;
- x.c_oflag = 0;
- x.c_cflag = 0;
- x.c_lflag = 0;
- x.c_cc[NCCS] = 0;],
-ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
-AC_MSG_RESULT($ac_cv_termios_struct)
-if test $ac_cv_termios_struct = yes; then
+AC_CACHE_CHECK([for struct termios],
+  [sim_cv_termios_struct],
+  [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termios.h>], [
+  static struct termios x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCCS] = 0;
+], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])])
+if test $sim_cv_termios_struct = yes; then
   AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
 fi
 
-if test "$ac_cv_termios_struct" = "yes"; then
+if test "$sim_cv_termios_struct" = "yes"; then
   AC_CACHE_VAL([sim_cv_termios_cline])
   AC_CHECK_MEMBER(
     [struct termios.c_line],
@@ -321,27 +321,27 @@ else
   sim_cv_termios_cline=no
 fi
 
-if test "$ac_cv_termios_struct" != "yes"; then
-  AC_MSG_CHECKING(for struct termio)
-  AC_CACHE_VAL(ac_cv_termio_struct,
-  [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/termio.h>],
-[static struct termio x;
- x.c_iflag = 0;
- x.c_oflag = 0;
- x.c_cflag = 0;
- x.c_lflag = 0;
- x.c_cc[NCC] = 0;],
-ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
-  AC_MSG_RESULT($ac_cv_termio_struct)
-  if test $ac_cv_termio_struct = yes; then
+if test "$sim_cv_termios_struct" != "yes"; then
+  AC_CACHE_CHECK([for struct termio],
+    [sim_cv_termio_struct],
+    [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termio.h>], [
+  static struct termio x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCC] = 0;
+], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])])
+  if test $sim_cv_termio_struct = yes; then
     AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
   fi
 else
-  ac_cv_termio_struct=no
+  sim_cv_termio_struct=no
 fi
 
-if test "$ac_cv_termio_struct" = "yes"; then
+if test "$sim_cv_termio_struct" = "yes"; then
   AC_CACHE_VAL([sim_cv_termio_cline])
   AC_CHECK_MEMBER(
     [struct termio.c_line],
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (3 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/ Mike Frysinger
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

This is the last compile-time logic in the ppc subdir.
---
 sim/config.h.in           |  12 +++
 sim/configure             | 138 ++++++++++++++++++++++++++-
 sim/m4/sim_ac_platform.m4 |  69 ++++++++++++++
 sim/ppc/config.in         |  12 ---
 sim/ppc/configure         | 192 --------------------------------------
 sim/ppc/configure.ac      |  69 --------------
 6 files changed, 217 insertions(+), 275 deletions(-)

diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index 6f3e48f63dd2..f523f03518bb 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -213,6 +213,75 @@ AS_IF([test x"$sim_cv_sysv_shm" = x"yes"], [dnl
   AC_DEFINE(HAVE_SYSV_SHM, 1, [Define if System V shared memory is supported])
 ])
 
+dnl Figure out what type of termio/termios support there is
+AC_CACHE_CHECK([for struct termios],
+  [sim_cv_termios_struct],
+  [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termios.h>], [
+  static struct termios x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCCS] = 0;
+], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])])
+if test $sim_cv_termios_struct = yes; then
+  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
+fi
+
+if test "$sim_cv_termios_struct" = "yes"; then
+  AC_CACHE_VAL([sim_cv_termios_cline])
+  AC_CHECK_MEMBER(
+    [struct termios.c_line],
+    [sim_cv_termios_cline="yes"],
+    [sim_cv_termios_cline="no"], [
+#include <sys/types.h>
+#include <sys/termios.h>
+])
+  if test $sim_cv_termios_cline = yes; then
+    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
+  fi
+else
+  sim_cv_termios_cline=no
+fi
+
+if test "$sim_cv_termios_struct" != "yes"; then
+  AC_CACHE_CHECK([for struct termio],
+    [sim_cv_termio_struct],
+    [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termio.h>], [
+  static struct termio x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCC] = 0;
+], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])])
+  if test $sim_cv_termio_struct = yes; then
+    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
+  fi
+else
+  sim_cv_termio_struct=no
+fi
+
+if test "$sim_cv_termio_struct" = "yes"; then
+  AC_CACHE_VAL([sim_cv_termio_cline])
+  AC_CHECK_MEMBER(
+    [struct termio.c_line],
+    [sim_cv_termio_cline="yes"],
+    [sim_cv_termio_cline="no"], [
+#include <sys/types.h>
+#include <sys/termio.h>
+])
+  if test $sim_cv_termio_cline = yes; then
+    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
+  fi
+else
+  sim_cv_termio_cline=no
+fi
+
 dnl Types used by common code
 AC_TYPE_GETGROUPS
 AC_TYPE_MODE_T
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 7b4b998e9487..b19be90ec33b 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -288,75 +288,6 @@ fi],[sim_xor_endian=""])dnl
 AC_CONFIG_HEADER(config.h:config.in)
 
 
-dnl Figure out what type of termio/termios support there is
-AC_CACHE_CHECK([for struct termios],
-  [sim_cv_termios_struct],
-  [AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/termios.h>], [
-  static struct termios x;
-  x.c_iflag = 0;
-  x.c_oflag = 0;
-  x.c_cflag = 0;
-  x.c_lflag = 0;
-  x.c_cc[NCCS] = 0;
-], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])])
-if test $sim_cv_termios_struct = yes; then
-  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
-fi
-
-if test "$sim_cv_termios_struct" = "yes"; then
-  AC_CACHE_VAL([sim_cv_termios_cline])
-  AC_CHECK_MEMBER(
-    [struct termios.c_line],
-    [sim_cv_termios_cline="yes"],
-    [sim_cv_termios_cline="no"], [
-#include <sys/types.h>
-#include <sys/termios.h>
-])
-  if test $sim_cv_termios_cline = yes; then
-    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
-  fi
-else
-  sim_cv_termios_cline=no
-fi
-
-if test "$sim_cv_termios_struct" != "yes"; then
-  AC_CACHE_CHECK([for struct termio],
-    [sim_cv_termio_struct],
-    [AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/termio.h>], [
-  static struct termio x;
-  x.c_iflag = 0;
-  x.c_oflag = 0;
-  x.c_cflag = 0;
-  x.c_lflag = 0;
-  x.c_cc[NCC] = 0;
-], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])])
-  if test $sim_cv_termio_struct = yes; then
-    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
-  fi
-else
-  sim_cv_termio_struct=no
-fi
-
-if test "$sim_cv_termio_struct" = "yes"; then
-  AC_CACHE_VAL([sim_cv_termio_cline])
-  AC_CHECK_MEMBER(
-    [struct termio.c_line],
-    [sim_cv_termio_cline="yes"],
-    [sim_cv_termio_cline="no"], [
-#include <sys/types.h>
-#include <sys/termio.h>
-])
-  if test $sim_cv_termio_cline = yes; then
-    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
-  fi
-else
-  sim_cv_termio_cline=no
-fi
-
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_opcode)
 AC_SUBST(sim_switch)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (4 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 08/10] sim: ppc: drop custom config.h header Mike Frysinger
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

The common sim code doesn't snoop in gdb/, and the ppc code doesn't
need to either.  Any common code we pull from gnulib/ now only.
---
 sim/ppc/Makefile.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 8eaad7424c44..9b0cd2cffe8b 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -113,9 +113,8 @@ MAKEOVERRIDES=
 
 LIB_INCLUDES	= -I$(srcdir)/../../include
 BFD_INCLUDES	= -I../../bfd -I$(srcdir)/../../bfd
-GDB_INCLUDES	= -I../../gdb -I$(srcdir)/../../gdb  -I$(srcdir)/../../gdb/config
 
-INCLUDES	= -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) -I../..
+INCLUDES	= -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) -I../..
 
 LIBIBERTY_LIB	= ../../libiberty/libiberty.a
 BFD_LIB		= ../../bfd/libbfd.la
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 08/10] sim: ppc: drop custom config.h header
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (5 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/ Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks Mike Frysinger
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

Now that everything has moved to the top-level, we can drop the
custom ppc config.h and reuse the common one.
---
 sim/ppc/Makefile.in  |  30 ++----
 sim/ppc/configure    | 216 ++++++++-----------------------------------
 sim/ppc/configure.ac |   6 +-
 sim/ppc/defs.h       |  53 -----------
 4 files changed, 50 insertions(+), 255 deletions(-)
 delete mode 100644 sim/ppc/defs.h

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 9b0cd2cffe8b..71199fc72ede 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -70,6 +70,7 @@ MONITOR_CFLAGS = @sim_monitor@
 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
 SWITCH_CFLAGS = @sim_switch@
 CONFIG_CFLAGS = \
+  -DHAVE_CONFIG_H \
   $(SMP_CFLAGS) \
   $(XOR_ENDIAN_CFLAGS) \
   $(BITSIZE_CFLAGS) \
@@ -141,9 +142,6 @@ COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
 COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
 
 # Headers in sim/ppc.
-ACCONFIG_H = \
-	acconfig.h
-
 ALTIVEC_EXPRESSION_H = \
 	altivec_expression.h
 
@@ -152,7 +150,6 @@ ALTIVEC_REGISTERS_H = \
 
 BASICS_H = \
 	basics.h \
-	$(CONFIG_H) \
 	$(INLINE_H) \
 	$(SIM_CALLBACKS_H) \
 	$(DEBUG_H) \
@@ -293,8 +290,7 @@ LF_H = \
 	lf.h
 
 MISC_H = \
-	misc.h \
-	$(CONFIG_H)
+	misc.h
 
 MON_H = \
 	mon.h \
@@ -353,9 +349,6 @@ WORDS_H = \
 
 
 # Generated headers.
-CONFIG_H = \
-        config.h
-
 DEFINES_H = \
         defines.h
 
@@ -406,8 +399,7 @@ BUILT_SRC_WO_CONFIG = \
 	hw.h hw.c
 
 BUILT_SRC = \
-	$(BUILT_SRC_WO_CONFIG) \
-	config.h
+	$(BUILT_SRC_WO_CONFIG)
 
 LIB_INLINE_SRC = \
 	psim.c \
@@ -505,9 +497,9 @@ psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
 
 bits.o: bits.c $(BASICS_H)
 
-debug.o: debug.c $(CONFIG_H) $(BASICS_H)
+debug.o: debug.c $(BASICS_H)
 
-sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
+sim-endian.o: sim-endian.c $(BASICS_H) $(SIM_ENDIAN_N_H)
 
 os_emul.o: os_emul.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H) $(EMUL_GENERIC_H) $(EMUL_NETBSD_H) $(EMUL_UNIX_H) $(EMUL_CHIRP_H) $(EMUL_BUGAPI_H)
 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
@@ -563,7 +555,7 @@ itable.o: itable.c $(ITABLE_H)
 
 mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
 
-sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H)
+sim-fpu.o: $(srcdir)/../common/sim-fpu.c
 	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c 
 
 # Rebuild options whenever something changes so the date/time is up to date.
@@ -571,8 +563,8 @@ options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H)
 	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
 
 defines.h: tmp-defines; @true
-tmp-defines: config.h Makefile
-	$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
+tmp-defines: Makefile
+	$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < ../config.h > tmp-defines.h
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
 	$(SILENCE) touch $@
 
@@ -693,7 +685,7 @@ clean mostlyclean:
 	rm -f tmp-* *.[oasi] core $(BUILT_SRC_WO_CONFIG)
 
 distclean realclean: clean
-	rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
+	rm -f TAGS Makefile config.cache config.status defines.h stamp-h config.log
 
 maintainer-clean: distclean
 	rm -f *~ *.log core *.core
@@ -701,10 +693,6 @@ maintainer-clean: distclean
 Makefile: Makefile.in config.status
 	CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
 
-config.h: stamp-h ; @true
-stamp-h: config.in config.status
-	CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
-
 config.status: configure
 	$(SHELL) ./config.status --recheck
 
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index b19be90ec33b..6dfc533a085b 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -285,9 +285,6 @@ if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
 fi],[sim_xor_endian=""])dnl
 
 
-AC_CONFIG_HEADER(config.h:config.in)
-
-
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_opcode)
 AC_SUBST(sim_switch)
@@ -309,5 +306,4 @@ AC_SUBST(sim_model)
 AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
 
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile)
diff --git a/sim/ppc/defs.h b/sim/ppc/defs.h
deleted file mode 100644
index ab7a142b8994..000000000000
--- a/sim/ppc/defs.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* The configure generated header settings.
-
-   Copyright 2002-2023 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 gnulib's various configure tests.  */
-#include "gnulib/config.h"
-
-/* This comes from gnulib.  Export it until ansidecl.h handles it.  */
-#define ATTRIBUTE_FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
-
-/* Reset macros that our config.h will provide.  */
-#undef PACKAGE
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_URL
-#undef PACKAGE_VERSION
-
-/* Include arch-specific sim's various configure tests.  */
-#include "config.h"
-
-/* Reset macros that our config.h will provide.  */
-#undef PACKAGE
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_URL
-#undef PACKAGE_VERSION
-
-/* Include common sim's various configure tests.  */
-#include "../config.h"
-
-#endif
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (6 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 08/10] sim: ppc: drop custom config.h header Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-02  5:36 ` [PATCH/submitted 10/10] sim: ppc: move defines.h generation to the top-level Mike Frysinger
  2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

Now that the ppc script only checks configure options and sets up
variables in the Makefile from those, delete all the compile related
logic to greatly simplify the configure script.
---
 sim/ppc/configure    | 1113 +-----------------------------------------
 sim/ppc/configure.ac |    6 -
 2 files changed, 1 insertion(+), 1118 deletions(-)

diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 6dfc533a085b..a68d9727b904 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -2,12 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../.. ../../config])
 
-AC_PROG_INSTALL
-AC_PROG_CC
-
-dnl The sim shouldn't be checking $target and changing behavior.  But it is,
-dnl and until we clean that up, we need to expand --target for use below.
-AC_CANONICAL_SYSTEM
 
 AC_ARG_ENABLE(sim-bitsize,
 [  --enable-sim-bitsize=n		Specify target bitsize (32 or 64).],
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH/submitted 10/10] sim: ppc: move defines.h generation to the top-level
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (7 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks Mike Frysinger
@ 2024-01-02  5:36 ` Mike Frysinger
  2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2024-01-02  5:36 UTC (permalink / raw)
  To: gdb-patches

Since we rely on the top-level config.h now, the defines.h generation
step should live here too.
---
 sim/Makefile.in     | 19 +++++++++++++------
 sim/ppc/Makefile.in | 10 ++--------
 sim/ppc/local.mk    |  9 +++++++++
 3 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 71199fc72ede..2f638b093939 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -489,7 +489,7 @@ PACKAGE_SRC = pk_disklabel.c
 PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
 
 
-$(TARGETLIB): tmp-igen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): tmp-igen tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
 
@@ -562,12 +562,6 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c
 options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
 	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
 
-defines.h: tmp-defines; @true
-tmp-defines: Makefile
-	$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < ../config.h > tmp-defines.h
-	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
-	$(SILENCE) touch $@
-
 #
 # Rules to create the built c source code files
 #
@@ -685,7 +679,7 @@ clean mostlyclean:
 	rm -f tmp-* *.[oasi] core $(BUILT_SRC_WO_CONFIG)
 
 distclean realclean: clean
-	rm -f TAGS Makefile config.cache config.status defines.h stamp-h config.log
+	rm -f TAGS Makefile config.cache config.status stamp-h config.log
 
 maintainer-clean: distclean
 	rm -f *~ *.log core *.core
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 8bcc7e7b9c39..e2d6197f5dd2 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -33,6 +33,15 @@ SIM_ALL_RECURSIVE_DEPS += common/libcommon.a
 
 noinst_PROGRAMS += %D%/run
 
+SIM_ALL_RECURSIVE_DEPS += %D%/defines.h
+%D%/defines.h: %D%/stamp-defines ; @true
+%D%/stamp-defines: config.h Makefile
+	$(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin
+	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h
+	$(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += %D%/defines.h %D%/stamp-defines
+
 %D%/spreg.c: @MAINT@ %D%/ppc-spr-table %D%/spreg-gen.py %D%/$(am__dirstamp)
 	$(AM_V_GEN)$(srcdir)/%D%/spreg-gen.py --source $@.tmp
 	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(srcdir)/%D%/spreg.c
-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH/submitted 01/10] sim: ppc: move long long test to top-level
  2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
                   ` (8 preceding siblings ...)
  2024-01-02  5:36 ` [PATCH/submitted 10/10] sim: ppc: move defines.h generation to the top-level Mike Frysinger
@ 2024-01-09 14:33 ` Tom Tromey
  2024-01-09 17:50   ` Mike Frysinger
  9 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2024-01-09 14:33 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:

Mike> While the sim code doesn't utilize HAVE_LONG_LONG itself, other code
Mike> (like libiberty) seem to, so check for it in the top-level for all
Mike> ports to leverage.

FWIW gdb solves this problem with gdb/libiberty.m4.  Really this is
something that should be provided or fixed in a better way by libiberty.

Tom

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH/submitted 01/10] sim: ppc: move long long test to top-level
  2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
@ 2024-01-09 17:50   ` Mike Frysinger
  2024-01-09 19:05     ` Tom Tromey
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Frysinger @ 2024-01-09 17:50 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On 09 Jan 2024 07:33, Tom Tromey wrote:
> >>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
> 
> Mike> While the sim code doesn't utilize HAVE_LONG_LONG itself, other code
> Mike> (like libiberty) seem to, so check for it in the top-level for all
> Mike> ports to leverage.
> 
> FWIW gdb solves this problem with gdb/libiberty.m4.  Really this is
> something that should be provided or fixed in a better way by libiberty.

in the mean time, seems like this file should get moved to gdbsupport/ since
gdb, gdbserver, and gdbsupport all rely on it ?  then it'd be more reasonable
for sim to include that directly.

thinking beyond that, config/acinclude.m4 has CYG_AC_PATH_LIBERTY, but no one
seems to be using that.  should we add config/libiberty.m4 and move all this
logic there ?  and prob have it take care of exporting a LIBIBERTY_LIB var ?
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH/submitted 01/10] sim: ppc: move long long test to top-level
  2024-01-09 17:50   ` Mike Frysinger
@ 2024-01-09 19:05     ` Tom Tromey
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Tromey @ 2024-01-09 19:05 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Tom Tromey, gdb-patches

>> FWIW gdb solves this problem with gdb/libiberty.m4.  Really this is
>> something that should be provided or fixed in a better way by libiberty.

Mike> in the mean time, seems like this file should get moved to gdbsupport/ since
Mike> gdb, gdbserver, and gdbsupport all rely on it ?  then it'd be more reasonable
Mike> for sim to include that directly.

It's fine by me.

Mike> thinking beyond that, config/acinclude.m4 has CYG_AC_PATH_LIBERTY, but no one
Mike> seems to be using that.  should we add config/libiberty.m4 and move all this
Mike> logic there ?  and prob have it take care of exporting a LIBIBERTY_LIB var ?

You'd probably want to open this discussion on gcc-patches.

I tend to think if bigger changes are being made here, then my
preferences would be:

1. Just avoid using any configure results in libiberty header files,
   perhaps by relying on more recent standard features.

2. Have libiberty namespace its configure results (i.e., rename them
   from the generic HAVE_* to LIBIBERTY_* or whatever) and provide /
   install a "libiberty-config.h".

3. What we have now, to me clearly the worst solution of the bunch.

Tom

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-09 19:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/ Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 08/10] sim: ppc: drop custom config.h header Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 10/10] sim: ppc: move defines.h generation to the top-level Mike Frysinger
2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
2024-01-09 17:50   ` Mike Frysinger
2024-01-09 19:05     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).