author | acorn |
Mon, 28 Jan 2013 10:55:30 -0500 | |
changeset 15439 | a72c53517fe7 |
parent 13963 | e5b53c306fb5 |
permissions | -rw-r--r-- |
10565 | 1 |
# |
13963
e5b53c306fb5
7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents:
13867
diff
changeset
|
2 |
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
10565 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. |
|
8 |
# |
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
# accompanied this code). |
|
14 |
# |
|
15 |
# You should have received a copy of the GNU General Public License version |
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
# |
|
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 |
|
21 |
# questions. |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
22 |
# |
10565 | 23 |
# |
24 |
||
25 |
# Rules to build gamma launcher, used by vm.make |
|
26 |
||
27 |
||
28 |
LAUNCHER_SCRIPT = hotspot |
|
29 |
LAUNCHER = gamma |
|
30 |
||
31 |
LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher |
|
32 |
LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher |
|
33 |
LAUNCHERFLAGS := $(ARCHFLAG) \ |
|
34 |
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ |
|
35 |
-I$(LAUNCHERDIR_SHARE) \ |
|
36 |
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ |
|
37 |
-DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ |
|
38 |
-DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ |
|
39 |
-DARCH=\"$(LIBARCH)\" \ |
|
40 |
-DGAMMA \ |
|
41 |
-DLAUNCHER_TYPE=\"gamma\" \ |
|
42 |
-DLINK_INTO_$(LINK_INTO) \ |
|
43 |
$(TARGET_DEFINES) |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
44 |
# Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al. |
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
45 |
LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist |
10565 | 46 |
|
47 |
ifeq ($(LINK_INTO),AOUT) |
|
48 |
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) |
|
49 |
LAUNCHER_MAPFILE = mapfile_reorder |
|
50 |
LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) |
|
51 |
LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) |
|
52 |
LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) |
|
53 |
else |
|
54 |
LAUNCHER.o = launcher.o |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
55 |
LFLAGS_LAUNCHER += -L`pwd` |
11593 | 56 |
|
57 |
# The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
58 |
# freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting |
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
59 |
# the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM |
11593 | 60 |
# first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is |
61 |
# statically linked with CoreFoundation framework libs. Unfortunately, gamma's |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
62 |
# unique searchpath results in some unresolved symbols in the framework |
11593 | 63 |
# libraries, because JDK libraries are inadvertently discovered first on the |
64 |
# searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*. |
|
65 |
# So, the actual filename collision is libjpeg.dylib and libJPEG.dylib. |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
66 |
# To resolve this, gamma needs to also statically link with the CoreFoundation |
11593 | 67 |
# framework libraries. |
68 |
||
69 |
ifeq ($(OS_VENDOR),Darwin) |
|
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
70 |
LFLAGS_LAUNCHER += -framework CoreFoundation |
11593 | 71 |
endif |
72 |
||
10565 | 73 |
LIBS_LAUNCHER += -l$(JVM) $(LIBS) |
74 |
endif |
|
75 |
||
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11593
diff
changeset
|
76 |
LINK_LAUNCHER = $(LINK.CC) |
10565 | 77 |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11593
diff
changeset
|
78 |
LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11593
diff
changeset
|
79 |
LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK) |
10565 | 80 |
|
81 |
LAUNCHER_OUT = launcher |
|
82 |
||
83 |
SUFFIXES += .d |
|
84 |
||
85 |
SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") |
|
86 |
SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") |
|
87 |
||
88 |
OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) |
|
89 |
||
90 |
DEPFILES := $(patsubst %.o,%.d,$(OBJS)) |
|
91 |
-include $(DEPFILES) |
|
92 |
||
93 |
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c |
|
94 |
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11593
diff
changeset
|
95 |
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) |
10565 | 96 |
|
97 |
$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c |
|
98 |
$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11593
diff
changeset
|
99 |
$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) |
10565 | 100 |
|
101 |
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) |
|
102 |
$(QUIETLY) echo Linking launcher... |
|
103 |
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) |
|
13867
32d7efe7a4eb
7198329: Add $(sort) to object files used in links makes binarties more consistent
ohair
parents:
13856
diff
changeset
|
104 |
$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER) |
10565 | 105 |
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) |
13856
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
106 |
# Sign the launcher with the development certificate (if present) so that it can be used |
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
107 |
# to run JStack, JInfo, et al. |
bb11e2aa5265
7193201: [OS X] The development launcher should be signed and given task_for_pid privileges
sla
parents:
11721
diff
changeset
|
108 |
$(QUIETLY) -codesign -s openjdk_codesign $@ |
10565 | 109 |
|
110 |
$(LAUNCHER): $(LAUNCHER_SCRIPT) |
|
111 |
||
112 |
$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script |
|
113 |
$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ |
|
114 |
$(QUIETLY) chmod +x $@ |
|
115 |