JDK-8043646 : libosxapp.dylib fails to build on Mac OS 10.9 with clang
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2014-05-21
  • Updated: 2022-06-27
  • Resolved: 2014-05-22
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.
JDK 8 JDK 9 Other
8u251Fixed 9 b22Fixed openjdk8u302Fixed
Undefined symbols for architecture x86_64:
  "_attachCurrentThread", referenced from:
      +[ThreadUtilities getJNIEnv] in ThreadUtilities.o
      +[ThreadUtilities getJNIEnvUncached] in ThreadUtilities.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[2]: *** [/Volumes/work/tot/jdk9/build/macosx-x86_64-normal-server-slowdebug/jdk/lib/libosxapp.dylib] Error 1

This is with JDK checked out using "hg clone http://hg.openjdk.java.net/jdk9/hs-rt jdk9" as of today (May 21, 2014)

JDK configured using "./configure --with-boot-jdk=`/usr/libexec/java_home -v 1.8` --with-debug-level=slowdebug --with-jobs=8" and build using "make images"
Fix Request (8u). Part of making 8u build using Xcode 12. Trivial change, applies cleanly.

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/06f6160721da User: lana Date: 2014-07-09 17:53:06 +0000

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/06f6160721da User: pchelko Date: 2014-05-22 11:46:23 +0000

Changing: inline void attachCurrentThread(void** env) { to: static inline void attachCurrentThread(void** env) { in ThreadUtilitlies.m will fix the problem.