RFR (S): 7125793: MAC: test_gamma should always work

James Melvin james.melvin at oracle.com
Sat Dec 31 08:43:50 PST 2011


This change fixes the 'gamma' simple launcher for HotSpot on Mac OS X.
There were 3 primary changes required to re-enable gamma...

1) Statically link with CoreFoundation framework to resolve symbols

The gamma launcher dlopen()s libjava.dylib from $JAVA_HOME/jre/lib.
Because Mac OS X files are case-insensitive by default, we collide on
$FRAMEWORK/libJPEG.dylib and ${JAVA_HOME}/jre/lib/libjpeg.dylib. This
resulted in unresolved symbols in the Mac OS X framework libraries. The
solution for gamma was to statically link with CoreFoundation framework
to properly resolve framework symbols and allow gamma to successfully
dlopen() libjava.dylib.

2) Adjust various paths to reflect no arch subdirs

On Mac OS X, there are no arch subdirs, e.g jre/lib vs jre/lib/<arch>.
Instead, one can use universal binaries to package multiple
architectures in a single binary. At the moment though, we are only
building 64-bit non-universal binaries. Note, the test_gamma script
assumes an Oracle JDK layout for JAVA_HOME, derived from ALT_BOOTDIR.
Using an Apple JDK for ALT_BOOTDIR will fail the test_gamma script
gracefully, as libjava.dylib is in a different, unexpected place.

3) Modify test_gamma script to set library path only for gamma launch

Setting DYLD_LIBRARY_PATH adversely affects the real java launcher(s).
Instead, set this later in the script only for the gamma launcher test
run. While in there, I took the liberty of decrypting the script to make
it more maintainable and more easily merged whenever we reconcile the
unix ports into a single codebase. There is no change to the script output.

Feedback welcome...


   JPRT  2011-12-31-061123.jmelvin.7125793
   local Mac OS X builds/tests

Thanks and Happy New Year!


More information about the hotspot-dev mailing list