comparison make/bsd/makefiles/launcher.make @ 6765:15ba0e7a3ff4

7193201: [OS X] The development launcher should be signed and given task_for_pid privileges Reviewed-by: sspitsyn, nloodin, mgronlun, coleenp
author sla
date Mon, 17 Sep 2012 11:46:19 +0200
parents 719f7007c8e8
children 37518f191ddb
comparison
equal deleted inserted replaced
6749:a6fe94b9759f 6765:15ba0e7a3ff4
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 # 18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any 20 # or visit www.oracle.com if you need additional information or have any
21 # questions. 21 # questions.
22 # 22 #
23 # 23 #
24 24
25 # Rules to build gamma launcher, used by vm.make 25 # Rules to build gamma launcher, used by vm.make
26 26
27 27
39 -DARCH=\"$(LIBARCH)\" \ 39 -DARCH=\"$(LIBARCH)\" \
40 -DGAMMA \ 40 -DGAMMA \
41 -DLAUNCHER_TYPE=\"gamma\" \ 41 -DLAUNCHER_TYPE=\"gamma\" \
42 -DLINK_INTO_$(LINK_INTO) \ 42 -DLINK_INTO_$(LINK_INTO) \
43 $(TARGET_DEFINES) 43 $(TARGET_DEFINES)
44 # Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al.
45 LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist
44 46
45 ifeq ($(LINK_INTO),AOUT) 47 ifeq ($(LINK_INTO),AOUT)
46 LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) 48 LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
47 LAUNCHER_MAPFILE = mapfile_reorder 49 LAUNCHER_MAPFILE = mapfile_reorder
48 LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) 50 LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
49 LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) 51 LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC)
50 LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) 52 LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
51 else 53 else
52 LAUNCHER.o = launcher.o 54 LAUNCHER.o = launcher.o
53 LFLAGS_LAUNCHER += -L`pwd` 55 LFLAGS_LAUNCHER += -L`pwd`
54 56
55 # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a 57 # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
56 # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting 58 # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
57 # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM 59 # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
58 # first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is 60 # first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
59 # statically linked with CoreFoundation framework libs. Unfortunately, gamma's 61 # statically linked with CoreFoundation framework libs. Unfortunately, gamma's
60 # unique searchpath results in some unresolved symbols in the framework 62 # unique searchpath results in some unresolved symbols in the framework
61 # libraries, because JDK libraries are inadvertently discovered first on the 63 # libraries, because JDK libraries are inadvertently discovered first on the
62 # searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*. 64 # searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
63 # So, the actual filename collision is libjpeg.dylib and libJPEG.dylib. 65 # So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
64 # To resolve this, gamma needs to also statically link with the CoreFoundation 66 # To resolve this, gamma needs to also statically link with the CoreFoundation
65 # framework libraries. 67 # framework libraries.
66 68
67 ifeq ($(OS_VENDOR),Darwin) 69 ifeq ($(OS_VENDOR),Darwin)
68 LFLAGS_LAUNCHER += -framework CoreFoundation 70 LFLAGS_LAUNCHER += -framework CoreFoundation
69 endif 71 endif
70 72
71 LIBS_LAUNCHER += -l$(JVM) $(LIBS) 73 LIBS_LAUNCHER += -l$(JVM) $(LIBS)
72 endif 74 endif
73 75
99 $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) 101 $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
100 $(QUIETLY) echo Linking launcher... 102 $(QUIETLY) echo Linking launcher...
101 $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) 103 $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
102 $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) 104 $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
103 $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) 105 $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
106 # Sign the launcher with the development certificate (if present) so that it can be used
107 # to run JStack, JInfo, et al.
108 $(QUIETLY) -codesign -s openjdk_codesign $@
104 109
105 $(LAUNCHER): $(LAUNCHER_SCRIPT) 110 $(LAUNCHER): $(LAUNCHER_SCRIPT)
106 111
107 $(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script 112 $(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
108 $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ 113 $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@