JDK-8022737 : Build failed on FreeBSD because thread_id_t is not u4
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: other
  • CPU: generic
  • Submitted: 2013-08-09
  • Updated: 2013-08-09
  • Resolved: 2013-08-09
Related Reports
Duplicate :  
Relates :  
Description
This seems to be an old problem, while we fix it on OS X, it is still broken for FreeBSD and likely other BSD platforms.

Understood that FreeBSD is not a supported platform, but we should not break the build in OpenJDK.

Error message is like following,

Compiling /home/henryjen/ws/lambda/hotspot/src/share/vm/gc_implementation/shared
/gcTraceSend.cpp
/home/henryjen/ws/lambda/hotspot/src/share/vm/gc_implementation/shared/gcTraceSe
nd.cpp: In member function 'void YoungGCTracer::send_promotion_failed_event(cons
t PromotionFailedInfo&) const':
/home/henryjen/ws/lambda/hotspot/src/share/vm/gc_implementation/shared/gcTraceSe
nd.cpp:112: error: invalid conversion from 'pthread*' to 'u4'
/home/henryjen/ws/lambda/hotspot/src/share/vm/gc_implementation/shared/gcTraceSe
nd.cpp:112: error:   initializing argument 1 of 'void EventPromotionFailed::set_
thread(u4)'
gmake[6]: *** [gcTraceSend.o] Error 1
gmake[5]: *** [the_vm] Error 2
gmake[4]: *** [product] Error 2
gmake[3]: *** [generic_build2] Error 2
gmake[2]: *** [product] Error 2
gmake[1]: *** [/home/henryjen/ws/lambda/build/bsd-x86_64-normal-server-release/h
otspot/_hotspot.timestamp] Error 2

Comments
There is a non-portable version can be used on FreeBSD, not sure if that works on other BSD platforms, pthread_np.h int pthread_getthreadid_np(void)
09-08-2013