Opened 7 hours ago

Last modified 80 minutes ago

#71049 assigned defect

openjdk21 @21.0.4+7: error: use of undeclared identifier 'NSBundleExecutableArchitectureARM64' on 10.14 and 10.15 — at Initial Version

Reported by: sambthompson (Sam Thompson) Owned by: breun (Nils Breunese)
Priority: Normal Milestone:
Component: ports Version: 2.10.2
Keywords: catalina mojave Cc:
Port: openjdk21

Description

See: https://build.macports.org/builders/ports-10.15_x86_64-builder/builds/196610/steps/install-port/logs/stdio

:info:build src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m:69:29: error: use of undeclared identifier 'NSBundleExecutableArchitectureARM64'; did you mean 'NSBundleExecutableArchitecturePPC64'?
:info:build         if (architecture == NSBundleExecutableArchitectureARM64) {
:info:build                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                             NSBundleExecutableArchitecturePPC64
:info:build /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:123:5: note: 'NSBundleExecutableArchitecturePPC64' declared here
:info:build     NSBundleExecutableArchitecturePPC64     = 0x01000012
:info:build     ^
:info:build 1 error generated.

It's unclear whether this is an upstream issue; the failing code in question is not tagged upstream for openjdk21, but is delivered in the tarball anyway. Upstream still claims to support from 10.12 for openjdk21.

However, I don't think it should not fail in any case (and clearly other builds of openjdk21 e.g. from IBM, Azul, etc. are successful/usable on 10.15 and 10.14), because the fragment in question is guarded with Objective C pragma @available, viz.

static BOOL isValidDisplayMode(CGDisplayModeRef mode) {
    // Workaround for apple bug FB13261205, since it only affects arm based macs
    // and arm support started with macOS 11 ignore the workaround for previous versions
    if (@available(macOS 11, *)) {
        if (architecture == -1) {
            architecture = [[NSRunningApplication currentApplication] executableArchitecture];
        }
        if (architecture == NSBundleExecutableArchitectureARM64) {
            return (CGDisplayModeGetPixelWidth(mode) >= 800);
        }
    }
    return (1 < CGDisplayModeGetWidth(mode) && 1 < CGDisplayModeGetHeight(mode));
}

However, it's not clear why this is not being honoured on builds on 10.14 and 10.15. I have to assume there is compiler support for this @available syntax (apparently since Xcode 9 / LLVM 5), since that does not generate an error.

Change History (0)

Note: See TracTickets for help on using tickets.