United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6349489 Fedora Core 4 gcc 4.0.1 flags method as deprecated
JDK-6349489 : Fedora Core 4 gcc 4.0.1 flags method as deprecated

Details
Type:
Bug
Submit Date:
2005-11-12
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2007-03-15
Component:
hotspot
OS:
linux
Sub-Component:
runtime
CPU:
x86
Priority:
P5
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs10 (b10)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
Compiling HotSpot on Fedora Core 4 with gcc 4.0.1 (20050727) produces:

    Compiling src/os_cpu/linux_i486/vm/os_linux_i486.cpp
    cc1plus: warnings being treated as errors
    src/os_cpu/linux_i486/vm/os_linux_i486.cpp: In function `void current_stack_region(unsigned char**, size_t*)':
    src/os_cpu/linux_i486/vm/os_linux_i486.cpp:594: warning: `pthread_attr_getstackaddr' is deprecated (declared at /usr/include/pthread.h:312)
    src/os_cpu/linux_i486/vm/os_linux_i486.cpp:594: warning: `pthread_attr_getstackaddr' is deprecated (declared at /usr/include/pthread.h:312)
    gmake[2]: *** [os_linux_i486.o] Error 1

For 6339849, I've added -Wno-deprecated-declarations to the CFLAGS_WARN for os_linux_i486.o and os_linux_amd64 to work around this problem.  But that's a band-aid.

The better solution would be to find some way to avoid calling pthread_attr_getstackaddr.  That would allow us to compile cleanly and get rid of all the goop I added to gcc.make.

                                    

Comments
SUGGESTED FIX

*** /tmp/geta20883	2005-11-14 20:21:58.469671989 +0300
--- os_linux_i486.cpp	2005-11-14 20:21:29.793530284 +0300
***************
*** 567,574 ****
  //    |                        |/
  // P2 +------------------------+ Thread::stack_base()
  //
! // ** P2 is the address returned from pthread_attr_getstackaddr(), P2 - P1
! //    is the stack size returned by pthread_attr_getstacksize().
  
  static void current_stack_region(address * bottom, size_t * size) {
    if (os::Linux::is_initial_thread()) {
--- 567,574 ----
  //    |                        |/
  // P2 +------------------------+ Thread::stack_base()
  //
! // ** P2 is the address returned from pthread_attr_getstack(), P2 - P1
! //    is the stack size returned by pthread_attr_getstack().
  
  static void current_stack_region(address * bottom, size_t * size) {
    if (os::Linux::is_initial_thread()) {
***************
*** 590,605 ****
         }
       }
  
!      void * top;
!      if (pthread_attr_getstackaddr(&attr, &top) != 0 || 
!          pthread_attr_getstacksize(&attr, size) != 0) {
!          fatal("Can not locate current stack attributes!");
       }
! 
!      pthread_attr_destroy(&attr);
! 
!      *bottom = (address) align_size_up((uintptr_t)top - *size, os::Linux::page_size());
!      *size   = (address)top - *bottom;
    }
    assert(os::current_stack_pointer() >= *bottom &&
           os::current_stack_pointer() < *bottom + *size, "just checking");
--- 590,600 ----
         }
       }
  
!      if (pthread_attr_getstack(&attr, (void**)bottom, size) != 0) {
!        fatal("Can not locate current stack attributes!");
       }
!      
!      pthread_attr_destroy(&attr);     
    }
    assert(os::current_stack_pointer() >= *bottom &&
           os::current_stack_pointer() < *bottom + *size, "just checking");
                                     
2005-11-14
EVALUATION

use new pthread function to get stack attributes.
                                     
2007-02-26



Hardware and Software, Engineered to Work Together