JDK-8260402 : [macos] Support MACOSX_VERSION_MIN target 11.0
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 17
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • OS: os_x
  • CPU: generic
  • Submitted: 2021-01-26
  • Updated: 2021-07-13
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Description
Currently MACOSX_VERSION_MIN is set to 10.9 for intel and 11.0 for aarch64
These produces some issues with deprecated definitions, for example:

jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m:300:39: error: 'NSAlphaFirstBitmapFormat' is deprecated: first deprecated in macOS 10.14 [-Werror,-Wdeprecated-declarations]
                        bitmapFormat: NSAlphaFirstBitmapFormat | NSAlphaNonpremultipliedBitmapFormat
                                      ^~~~~~~~~~~~~~~~~~~~~~~~
                                      NSBitmapFormatAlphaFirst
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:161:29: note: 'NSAlphaFirstBitmapFormat' has been explicitly marked deprecated here
static const NSBitmapFormat NSAlphaFirstBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatAlphaFirst", macos(10.5,10.14)) = NSBitmapFormatAlphaFirst;
                            ^
jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m:300:66: error: 'NSAlphaNonpremultipliedBitmapFormat' is deprecated: first deprecated in macOS 10.14 [-Werror,-Wdeprecated-declarations]
                        bitmapFormat: NSAlphaFirstBitmapFormat | NSAlphaNonpremultipliedBitmapFormat
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                 NSBitmapFormatAlphaNonpremultiplied
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:162:29: note: 'NSAlphaNonpremultipliedBitmapFormat' has been explicitly marked deprecated here
static const NSBitmapFormat NSAlphaNonpremultipliedBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatAlphaNonpremultiplied", macos(10.0,10.14)) = NSBitmapFormatAlphaNonpremultiplied;
                            ^
jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m:438:34: error: 'NSBorderlessWindowMask' is deprecated: first deprecated in macOS 10.12 [-Werror,-Wdeprecated-declarations]
                      styleMask: NSBorderlessWindowMask
                                 ^~~~~~~~~~~~~~~~~~~~~~
                                 NSWindowStyleMaskBorderless
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:885:32: note: 'NSBorderlessWindowMask' has been explicitly marked deprecated here
static const NSWindowStyleMask NSBorderlessWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskBorderless", macos(10.0,10.12)) = NSWindowStyleMaskBorderless;

these definition can be updated to their newer versions (for example NSBorderlessWindowMask to NSWindowStyleMaskBorderless) but this might break current macos_intel code (as minimal version for intel is 10.9 and some of new definitions are 10.12+.
Solution universal to macos_intel (10.9 target) and macos_arch64(11.0 target) needs to be implemented

Currently these warnings are suppressed by "DISABLED_WARNINGS_clang := deprecated-declarations" in Awt2dLibraries.gmk
Comments
Changing subject back to 11.0 because that is what we are requesting here. The macos/aarch64 port needs to target 11.0 because that's the first release available on that architecture. We will be targeting different versions of Macos depending on architecture.
28-01-2021

I have filed JDK-8260518 to just bump the default macosx-version-min. I only needed to add deprecated-declarations to libsplashscreen. Can you fix the code and remove that warning in this bug after I push my change?
27-01-2021

I think you are referring to JDK-8257633 where I fixed the build to apply the global macos version options to the Hotspot build. Before that, the macos version for libjvm was implicitly set to the default for the SDK you used to build OpenJDK. What we need from this bug is the ability to build for 10.12 when building for intel and 11.0 when building for aarch64. We may still need to turn off deprecation warnings in some cases for just trying to support that version range. Or, I could open a separate bug, bump the target version and add ignoring of deprecation warnings where needed and then open followups on the component teams to fix them. Maybe that's a better strategy.
27-01-2021

Shouldn't the synopsis of this bug be changed to reference 10.12 ?
26-01-2021

IIRC correctly there is some bug that hotspot targets 10.12 already so bumping the SDK up to 10.12 would handily bring those back into alignment wouldn't it ?
26-01-2021

Just changing that value will trigger a bunch of deprecation warnings, probably the same ones triggered here. It would make more sense to change those at the same time. Attaching patch needed.
26-01-2021

there are similar kind of issues in libharfbuzz https://github.com/openjdk/jdk/pull/2200#discussion_r563917748
26-01-2021

[~erikj] If you agreed to bump the macOS version, can you please update it via some specific separate CR?
26-01-2021

I picked the target for intel mac a while back. So far, I've kept it intentionally conservative and just bumped it when there was a hard requirement to do so. Initially we set it to 10.7, which matched the build platform we used at Oracle at the time (back in JDK 7). Eventually we had to bump it to 10.9 when we switched to Clang in Xcode. At this point in time, 10.9 is ancient, and there is really no point in continuing to support such an old version of Macos. Bumping the default minimum version to 10.12 doesn't seem outlandish to me. Even 10.12 ended support in 2019.
26-01-2021