[aarch64-port-dev ] Can't build on macOS on arm64

Simon Tooke stooke at redhat.com
Sun Nov 22 19:57:10 UTC 2020


On 2020-11-21 6:21 a.m., Kirill A. Korinsky wrote:
> Good day,
>
> I'm playing with new Apple M1 cpu and can't build openjdk for it.
>
> As local source I'm using 47396be from https://github.com/openjdk/aarch64-port/tree/jdk-macos <https://github.com/openjdk/aarch64-port/tree/jdk-macos> and Azul JDK build 16-ea+24 for macOS adm64 from https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk <https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk>
>
> The build is crashed on with error
>
> * For target support_native_java.base_libosxsecurity_BUILD_LIBOSXSECURITY_link:
> ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation.tbd
> Undefined symbols for architecture arm64:
>    "_JNFCallVoidMethod", referenced from:
>        _Java_apple_security_KeychainStore__1scanKeychain in KeystoreImpl.o
>    "_JNFJavaToNSString", referenced from:
>        _Java_apple_security_KeychainStore__1addItemToKeychain in KeystoreImpl.o
>    "_JNFNativeMethodEnter", referenced from:
>        _Java_apple_security_KeychainStore__1addItemToKeychain in KeystoreImpl.o
>    "_JNFNativeMethodExit", referenced from:
>        _Java_apple_security_KeychainStore__1addItemToKeychain in KeystoreImpl.o
>    "_OBJC_CLASS_$_JNFException", referenced from:
>        objc-class-ref in KeystoreImpl.o
> ld: symbol(s) not found for architecture arm64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
> Inside JavaNativeFoundation.tbd I can find the only x86_64-maco target.

This is an XCode build error, and should be raised as an issue at Apple.

I notice that the JavaRuntimeSupport framework is properly built, so it 
must be an oversight.

In the meantime, perhaps try a static build?  In 
make/lib/Libb-java.base.gmk, I see it doesn't build the security library 
in static mode.

Alternatively, stub the routines for now; I know this port is still a 
work in progress.

Perhaps one of the developers can comment on how they got past this.

(Disclaimer; I am not working on this port, so I just looked into this 
today)

-Simon

--
Simon Tooke
Principal software developer, JDK team
Red Hat Canada, Inc.

stooke at redhat.com


>
> --
> wbr, Kirill
>



More information about the aarch64-port-dev mailing list