When building with some versions of the macOS SDK, you can get errors like this:

Undefined symbols for architecture x86_64:
??"_objc_loadClassref", referenced from:
??????__ARCLite__load() in libarclite_macosx.a(arclite.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [/Users/dnsimon/jdk-jdk/build/macosx-x86_64-server-release/support/modules_libs/java.base/libosxsecurity.dylib] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [java.base-libs] Error 2

This is due to the use of -fobjc-link-runtime in libosxsecurity. It turns out that what was really needed was to link to the objc library. This patch does this instead. It has been shown to work under a variety of macOS versions.

Bug: https://bugs.openjdk.java.net/browse/JDK-8231572
WebRev: http://cr.openjdk.java.net/~ihse/JDK-8231572-use-lobjc-in-libosxsecurity/webrev.01

/Magnus

Reply via email to