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

Kirill A. Korinsky kirill at korins.ky
Mon Nov 23 01:52:29 UTC 2020


Thanks for advice.

I've added `--enable-static-build` as configure option and now it fails with

Compiling 951 files for jdk.hotspot.agent
Creating support/modules_libs/java.base/libverify.a from 1 file(s)
Creating support/modules_libs/java.base/libjava.a from 61 file(s)
Creating support/native/java.base/libfdlibm.a from 57 file(s)
Creating support/modules_libs/java.base/libzip.a from 5 file(s)
Creating support/modules_libs/java.base/libjimage.a from 6 file(s)
Creating support/modules_libs/java.base/libjli.a from 8 file(s)
Creating support/modules_libs/java.base/libnet.a from 22 file(s)
Creating support/modules_libs/java.base/libnio.a from 22 file(s)
Getting symbols from nm
Getting symbols from nm
make[3]: *** [/Users/catap/src/openjdk-aarch64-port/build/macosx-aarch64-server-release/support/native/java.base/libfdlibm.a] Error 1
make[3]: *** Deleting file `/Users/catap/src/openjdk-aarch64-port/build/macosx-aarch64-server-release/support/native/java.base/libfdlibm.a'
make[3]: *** Waiting for unfinished jobs....
Getting symbols from nm
make[2]: *** [java.base-libs] Error 2

ERROR: Build failed for target 'images' in configuration 'macosx-aarch64-server-release' (exit code 2)
Stopping sjavac server

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

make[1]: *** [main] Error 2
make: *** [images] Error 2



--
wbr, Kirill

> On 22. Nov 2020, at 20:57, Simon Tooke <stooke at redhat.com> wrote:
> 
> 
> 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