This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed for older AIX physmem.c problems (PR 10974)
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: china at thewrittenword dot com, dj at redhat dot com, dje at watson dot ibm dot com
- Date: Mon, 9 Jun 2003 01:27:17 -0400 (EDT)
- Subject: Patch installed for older AIX physmem.c problems (PR 10974)
This patch comes from and fixes PR 10974. The problem involves
physmem.c on older AIX systems which are missing a relevant structure
member and wouldn't compile. The patch introduces a better check for
this. I've applied it at the request of David Edelsohn. (The PR
patch didn't contain a ChangeLog so I wrote one.)
Applied to mainline and 3.3.
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/ChangeLog,v
retrieving revision 1.398.2.26
diff -u -p -r1.398.2.26 ChangeLog
--- ChangeLog 5 Jun 2003 17:44:59 -0000 1.398.2.26
+++ ChangeLog 9 Jun 2003 05:16:42 -0000
@@ -1,3 +1,11 @@
+2003-06-09 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * physmem.c: Update comment.
+ * configure.in: Modify test for _system_configuration for older
+ AIX systems.
+
+ * config.in, configure: Regenerated.
+
2003-06-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR other/10810
Index: physmem.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/physmem.c,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 physmem.c
--- physmem.c 27 Feb 2003 20:19:25 -0000 1.1.2.9
+++ physmem.c 9 Jun 2003 05:16:42 -0000
@@ -145,7 +145,7 @@ physmem_total ()
#endif
#if HAVE__SYSTEM_CONFIGURATION
- /* This works on AIX. */
+ /* This works on AIX 4.3.3+. */
return _system_configuration.physmem;
#endif
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/configure.in,v
retrieving revision 1.52.14.9
diff -u -p -r1.52.14.9 configure.in
--- configure.in 14 Apr 2003 14:24:30 -0000 1.52.14.9
+++ configure.in 9 Jun 2003 05:16:42 -0000
@@ -203,7 +203,7 @@ funcs="$funcs waitpid"
# Also in the old function.def file: alloca, vfork, getopt.
-vars="sys_errlist sys_nerr sys_siglist _system_configuration"
+vars="sys_errlist sys_nerr sys_siglist"
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
checkfuncs="$checkfuncs pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl"
@@ -222,7 +222,6 @@ if test "x" = "y"; then
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
- AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])
fi
# For each of these functions, if the host does not provide the
@@ -425,6 +424,17 @@ if test -z "${setobjs}"; then
AC_MSG_RESULT(no)
fi
done
+
+ # special check for _system_configuration because AIX <4.3.2 do not
+ # contain the `physmem' member.
+ AC_MSG_CHECKING([for external symbol _system_configuration])
+ AC_TRY_COMPILE([#include <sys/systemcfg.h>],
+ [double x = _system_configuration.physmem;],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
+ [Define if you have the _system_configuration variable.])],
+ [AC_MSG_RESULT([no])])
+
AC_CHECK_FUNCS($checkfuncs)
fi