2008-10-02 Joel Brobecker On ia64-hpux version 11.31, there is no anymore. * configure.in: Add check for sys/ptrace.h. * configure, include/config.h.in: Regenerate. * src/ptrace/_UPT_internal.h: Include sys/ptrace.h only when available. Also, include AFTER including "internal.h". Otherwise, "config.h" hasn't been included yet, and thus HAVE_SYS_PTRACE_H was not defined. 2005-09-02 Joel Brobecker * Ginit.c (tdep_uc_addr): New function. Needed to avoid a link failure. 2005-09-02 Joel Brobecker This patches fixes a problem on ia64-hpux when trying to build this package using GCC 3.4.4. The makefile was incorrectly using -lgcc instead of -lgcc_s to build the libunwind shared library. libtool noticed that libgcc does not exist in a shared library version, and hence removed it from the list of dependencies (after printing a warning). This adds the missing dependency back, so that another program dlopen()'ing it doesn't fail due to unresolved symbols. * configure.in (LIBCRTS): Use -lgcc_s instead of -lgcc when needed. * configure: Regenerate. Index: configure =================================================================== --- configure (revision 131627) +++ configure (revision 131628) @@ -20870,6 +20870,16 @@ rm -f conftest.err conftest.$ac_objext c if test x$GCC = xyes -a x$intel_compiler != xyes; then CFLAGS="${CFLAGS} -Wall -Wsign-compare" LIBCRTS="-lgcc" + + # What we really want to do is link our libraries against is the shared + # version of libgcc. Unfortunately, this library may either be named + # libgcc or libgcc_s. Try to see if GCC recognizes libgcc_s, in which + # case we should be linking against libgcc_s. + libgcc_s_so=libgcc_s.so + libgcc_s_path=`$CC -print-file-name=$libgcc_s_so` + if test x$libgcc_s_path != x$libgcc_s_so; then + LIBCRTS="-lgcc_s" + fi fi CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}" Index: configure.in =================================================================== --- configure.in (revision 131627) +++ configure.in (revision 131628) @@ -103,6 +103,16 @@ AC_TRY_COMPILE([], [#ifndef __INTEL_COMP if test x$GCC = xyes -a x$intel_compiler != xyes; then CFLAGS="${CFLAGS} -Wall -Wsign-compare" LIBCRTS="-lgcc" + + # What we really want to do is link our libraries against is the shared + # version of libgcc. Unfortunately, this library may either be named + # libgcc or libgcc_s. Try to see if GCC recognizes libgcc_s, in which + # case we should be linking against libgcc_s. + libgcc_s_so=libgcc_s.so + libgcc_s_path=`$CC -print-file-name=$libgcc_s_so` + if test x$libgcc_s_path != x$libgcc_s_so; then + LIBCRTS="-lgcc_s" + fi fi CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}" Index: src/ia64/Ginit.c =================================================================== --- src/ia64/Ginit.c (revision 131628) +++ src/ia64/Ginit.c (revision 131629) @@ -82,6 +82,17 @@ PROTECTED unw_addr_space_t unw_local_add #ifdef HAVE_SYS_UC_ACCESS_H +void * +tdep_uc_addr (ucontext_t *uc, int reg, uint8_t *nat_bitnr) +{ + /* brobecker/2005-09-01: I couldn't find a way of implementing this + on ia64-hpux, as the uc structure is opaque. The OS provides + ways to get the values themselves, but not their address. However, + I haven't seen this procedure being used at all so far, so we'll + just return NULL for now. */ + return NULL; +} + #else /* !HAVE_SYS_UC_ACCESS_H */ HIDDEN void * Index: configure =================================================================== --- configure (revision 135785) +++ configure (revision 136181) @@ -19740,7 +19740,7 @@ fi for ac_header in asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \ - sys/uc_access.h unistd.h signal.h + sys/uc_access.h unistd.h signal.h sys/ptrace.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then Index: include/config.h.in =================================================================== --- include/config.h.in (revision 135785) +++ include/config.h.in (revision 136181) @@ -60,6 +60,9 @@ /* Define to 1 if `dlpi_subs' is member of `struct dl_phdr_info'. */ #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PTRACE_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H Index: configure.in =================================================================== --- configure.in (revision 135785) +++ configure.in (revision 136181) @@ -28,7 +28,7 @@ CHECK_ATOMIC_OPS dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \ - sys/uc_access.h unistd.h signal.h) + sys/uc_access.h unistd.h signal.h sys/ptrace.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST Index: src/ptrace/_UPT_internal.h =================================================================== --- src/ptrace/_UPT_internal.h (revision 135785) +++ src/ptrace/_UPT_internal.h (revision 136181) @@ -32,11 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE #include #include -#include - #include "internal.h" #include "tdep.h" +#ifdef HAVE_SYS_PTRACE_H +#include +#endif + struct UPT_info { pid_t pid; /* the process-id of the child we're unwinding */