This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Java] Restore bootstrap on Alpha/Tru64


Many thanks to Andrew Haley for help diagnosing and suggesting an
appropriate fix.  The following patch fixes the build of libjava
on alphaev67-dec-osf5.1.  The problem is that Tru64/OSF1 does have
a <dlfcn.h> system header, but it doesn't provide the "dladdr"
function (only dlopen, dlclose, dlsym, etc...)  The fix below is
to guard uses of "dladdr" with HAVE_DLFCN_H and HAVE_DLADDR rather
than just HAVE_DLFCN_H.  This matches the idiom already used in
libjava's stacktrace.cc.

The following patch has been tested on alphaev67-dec-osf5.1 with
a full "make bootstrap", including java, which finishes with this
change but fails building libjava without it.  Regression testing
in progress, but I don't have an unpatched baseline, and don't
expect the java testsuite results to be without unrelated failures.

Ok for mainline?



2006-05-01  Roger Sayle  <roger@eyesopen.com>
	    Andrew Haley  <aph@redhat.com>

	* boehm.cc (_Jv_InitGC): Check both HAVE_DLFCN_H and HAVE_DLADDR
	before calling GC_register_has_static_roots_callback.
	(_Jv_RegisterLibForGc): Likewise, test for both HAVE_DLFCN_H and
	HAVE_DLADDR before calling dladdr.


Index: boehm.cc
===================================================================
*** boehm.cc	(revision 113354)
--- boehm.cc	(working copy)
*************** _Jv_InitGC (void)
*** 486,492 ****
    // Ignore pointers that do not point to the start of an object.
    GC_all_interior_pointers = 0;

! #ifdef HAVE_DLFCN_H
    // Tell the collector to ask us before scanning DSOs.
    GC_register_has_static_roots_callback (_Jv_GC_has_static_roots);
  #endif
--- 486,492 ----
    // Ignore pointers that do not point to the start of an object.
    GC_all_interior_pointers = 0;

! #if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
    // Tell the collector to ask us before scanning DSOs.
    GC_register_has_static_roots_callback (_Jv_GC_has_static_roots);
  #endif
*************** _Jv_GCCanReclaimSoftReference (jobject)
*** 581,587 ****



! #ifdef HAVE_DLFCN_H

  // We keep a store of the filenames of DSOs that need to be
  // conservatively scanned by the garbage collector.  During collection
--- 581,587 ----



! #if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)

  // We keep a store of the filenames of DSOs that need to be
  // conservatively scanned by the garbage collector.  During collection
*************** _Jv_GC_has_static_roots (const char *fil
*** 661,667 ****
  void
  _Jv_RegisterLibForGc (const void *p __attribute__ ((__unused__)))
  {
! #ifdef HAVE_DLFCN_H
    Dl_info info;

    if (dladdr (const_cast<void *>(p), &info) != 0)
--- 661,667 ----
  void
  _Jv_RegisterLibForGc (const void *p __attribute__ ((__unused__)))
  {
! #if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
    Dl_info info;

    if (dladdr (const_cast<void *>(p), &info) != 0)

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]