From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Edelsohn To: Kevin Buettner , Nicholas Duffek Cc: gdb-patches@sources.redhat.com, Albert Chin-A-Young Subject: [PATCH] bfd/rs6000-core.c Date: Sat, 23 Jun 2001 22:23:00 -0000 Message-id: <200106240523.BAA24138@makai.watson.ibm.com> X-SW-Source: 2001-06/msg00391.html The new AIX 4.3+ core support assumes a field in the core_dumpx structure defined in /usr/include/sys/core.h that only exists in AIX 4.3.3 and not earlier releases. This prevents binutils from building on AIX 4.3.2. Albert and I have worked out the appended patch. David * rs6000-core.c: Use autoconf variable HAVE_ST_C_IMPL to guard use of c_impl field. * configure.in: Auto-configure HAVE_ST_C_IMPL. * configure.in: Likewise. --- bfd/configure.in.orig Fri Jun 22 13:09:23 2001 +++ bfd/configure.in Fri Jun 22 13:18:11 2001 @@ -301,6 +301,15 @@ changequote([,])dnl COREFILE=rs6000-core.lo COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" + + # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE + # have c_impl as a member of struct core_dumpx + AC_MSG_CHECKING([for c_impl in struct core_dumpx]) + AC_TRY_COMPILE([#include ], + [struct core_dumpx c; c.c_impl = 0;], + [AC_DEFINE(HAVE_ST_C_IMPL, 1, + [Define if struct core_dumpx has member c_impl]) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ;; rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; rs6000-*-*) COREFILE=rs6000-core.lo ;; --- bfd/config.in.orig Fri Jun 22 13:17:50 2001 +++ bfd/config.in Fri Jun 22 13:18:31 2001 @@ -208,6 +208,9 @@ /* Define if getenv is not declared in system header files. */ #undef NEED_DECLARATION_GETENV +/* Define if struct core_dumpx has member c_impl */ +#undef HAVE_ST_C_IMPL + /* Define if has prstatus_t. */ #undef HAVE_PRSTATUS_T --- bfd/rs6000-core.c.orig Fri Jun 22 13:11:09 2001 +++ bfd/rs6000-core.c Fri Jun 22 13:11:26 2001 @@ -182,7 +182,7 @@ /* Return the c_impl field from struct core_dumpx C. */ -#ifdef AIX_CORE_DUMPX_CORE +#ifdef HAVE_ST_C_IMPL # define CNEW_IMPL(c) (c).c_impl #else # define CNEW_IMPL(c) 0