JDK-8321141 : VM build issue on MacOS after JDK-8267532
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2023-11-30
  • Updated: 2023-12-11
  • Resolved: 2023-12-01
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 22
22 b27Fixed
Related Reports
Relates :  
Description
It was reported externally and I hit it myself on my Mac-x86 with old Xcode12.4 when building fastdebug VM with only open sources

src/hotspot/share/ci/ciMethodData.cpp:485:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.

JDK-8267532 added new method ciMethodData::exception_handler_bci_to_data() with ShouldNotReachHere() call on one exit withpout returning any value.
Comments
This fixed it for me on macOS 13.6 with xcode 12.5 - initially I thought it did not, but it does fix it.
04-12-2023

ILW = Build failure on MacOS, only with older Xcode, no workaround = HLH = P2
01-12-2023

Changeset: 02ffab1a Author: Vladimir Kozlov <kvn@openjdk.org> Date: 2023-12-01 03:35:31 +0000 URL: https://git.openjdk.org/jdk/commit/02ffab1a4d9e1209f3f1da715acae975e0754551
01-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16914 Date: 2023-11-30 23:29:48 +0000
30-11-2023

Thanks!
30-11-2023

Fair. I will take it since I tested the fix on my machine.
30-11-2023

I can check, but I thought some compilers issue a warning for unreachable code because it is code after a [[noreturn]] call. I'm not on mac so I can't reproduce the error locally (and mach5 uses xcode 14). I can try and source a machine, but maybe it's easier if someone else who's seeing the issue takes this one. I'm also happy to file a PR that adds `return ciBitData(nullptr);` if that fixes the issue.
30-11-2023

Can we just add `return ciBitData(nullptr);` there and allow it to build with old Xcode?
30-11-2023

FWIW, the building guide recommends at least XCode 14: https://github.com/openjdk/jdk/blob/master/doc/building.md#macos
30-11-2023

ShouldNotReachHere calls report_should_not_reach_here which is marked with ATTRIBUTE_NORETURN, maybe this attribute doesn't work on older versions of xcode?
30-11-2023