1.1 --- a/make/bsd/makefiles/launcher.make Fri Sep 14 22:00:41 2012 -0700 1.2 +++ b/make/bsd/makefiles/launcher.make Mon Sep 17 11:46:19 2012 +0200 1.3 @@ -19,7 +19,7 @@ 1.4 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.5 # or visit www.oracle.com if you need additional information or have any 1.6 # questions. 1.7 -# 1.8 +# 1.9 # 1.10 1.11 # Rules to build gamma launcher, used by vm.make 1.12 @@ -41,6 +41,8 @@ 1.13 -DLAUNCHER_TYPE=\"gamma\" \ 1.14 -DLINK_INTO_$(LINK_INTO) \ 1.15 $(TARGET_DEFINES) 1.16 +# Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al. 1.17 +LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist 1.18 1.19 ifeq ($(LINK_INTO),AOUT) 1.20 LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) 1.21 @@ -50,22 +52,22 @@ 1.22 LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) 1.23 else 1.24 LAUNCHER.o = launcher.o 1.25 - LFLAGS_LAUNCHER += -L`pwd` 1.26 + LFLAGS_LAUNCHER += -L`pwd` 1.27 1.28 # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a 1.29 - # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting 1.30 - # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM 1.31 + # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting 1.32 + # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM 1.33 # first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is 1.34 # statically linked with CoreFoundation framework libs. Unfortunately, gamma's 1.35 - # unique searchpath results in some unresolved symbols in the framework 1.36 + # unique searchpath results in some unresolved symbols in the framework 1.37 # libraries, because JDK libraries are inadvertently discovered first on the 1.38 # searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*. 1.39 # So, the actual filename collision is libjpeg.dylib and libJPEG.dylib. 1.40 - # To resolve this, gamma needs to also statically link with the CoreFoundation 1.41 + # To resolve this, gamma needs to also statically link with the CoreFoundation 1.42 # framework libraries. 1.43 1.44 ifeq ($(OS_VENDOR),Darwin) 1.45 - LFLAGS_LAUNCHER += -framework CoreFoundation 1.46 + LFLAGS_LAUNCHER += -framework CoreFoundation 1.47 endif 1.48 1.49 LIBS_LAUNCHER += -l$(JVM) $(LIBS) 1.50 @@ -101,6 +103,9 @@ 1.51 $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) 1.52 $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) 1.53 $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) 1.54 + # Sign the launcher with the development certificate (if present) so that it can be used 1.55 + # to run JStack, JInfo, et al. 1.56 + $(QUIETLY) -codesign -s openjdk_codesign $@ 1.57 1.58 $(LAUNCHER): $(LAUNCHER_SCRIPT) 1.59