JDK-6349489 : Fedora Core 4 gcc 4.0.1 flags method as deprecated
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2005-11-12
  • Updated: 2017-09-14
  • Resolved: 2007-03-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Related Reports
Relates :  
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
EVALUATION use new pthread function to get stack attributes.
26-02-2007

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");
14-11-2005