JDK-8077674 : BSD build failures due to undefined macros
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u60,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2015-04-14
  • Updated: 2015-09-29
  • Resolved: 2015-04-21
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 8 JDK 9
8u60Fixed 9 b64Fixed
Description
Martijn Verburg reports:

On Mac OS X 10.10.2 using gcc 4.8 run make clean images

When compiling either jdk8 or jdk9 from scratch I get the following BSD
undefined errors:

Compiling
/Users/karianna/Documents/workspace/AdoptOpenJDK_projects/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp
/Users/karianna/Documents/workspace/AdoptOpenJDK_projects/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1150:7:
error: "__FreeBSD__" is not defined [-Werror=undef]
 #elif __FreeBSD__
       ^
/Users/karianna/Documents/workspace/AdoptOpenJDK_projects/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1152:7:
error: "__OpenBSD__" is not defined [-Werror=undef]
 #elif __OpenBSD__
       ^
/Users/karianna/Documents/workspace/AdoptOpenJDK_projects/jdk8/hotspot/src/os/bsd/vm/os_bsd.cpp:1154:7:
error: "__NetBSD__" is not defined [-Werror=undef]
 #elif __NetBSD__
       ^

Comments
"-Wundef option causes GCC to warn whenever it encounters an identifier which is not a macro in an ���#if���. " Hence we should be using #elif defined(__FreeBSD__) etc in this context.
14-04-2015