Mercurial > hg > graal-jvmci-8
annotate make/bsd/makefiles/saproc.make @ 24227:b5a90e4a6c26 jvmci-0.34
make internal_vm_info_string() consistent with java.vm.version
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 25 Aug 2017 14:25:06 +0200 |
parents | 7f298e4d1afb |
children |
rev | line source |
---|---|
3960 | 1 # |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
2 # Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
3960 | 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. | |
22 # | |
23 # | |
24 | |
25 # Rules to build serviceability agent library, used by vm.make | |
26 | |
8750 | 27 # libsaproc.so(dylib): serviceability agent |
3960 | 28 SAPROC = saproc |
29 | |
30 ifeq ($(OS_VENDOR), Darwin) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
31 LIBSAPROC = lib$(SAPROC).dylib |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
32 |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
33 LIBSAPROC_DEBUGINFO = lib$(SAPROC).dylib.dSYM |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
34 LIBSAPROC_DIZ = lib$(SAPROC).diz |
3960 | 35 else |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
36 LIBSAPROC = lib$(SAPROC).so |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
37 |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
38 LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
39 LIBSAPROC_DIZ = lib$(SAPROC).diz |
3960 | 40 endif |
41 | |
42 AGENT_DIR = $(GAMMADIR)/agent | |
43 | |
44 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) | |
45 | |
8750 | 46 BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \ |
6782 | 47 $(SASRCDIR)/symtab.c \ |
48 $(SASRCDIR)/libproc_impl.c \ | |
49 $(SASRCDIR)/ps_proc.c \ | |
50 $(SASRCDIR)/ps_core.c \ | |
51 $(SASRCDIR)/BsdDebuggerLocal.c \ | |
52 $(AGENT_DIR)/src/share/native/sadis.c | |
4006 | 53 |
8750 | 54 DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \ |
55 $(SASRCDIR)/libproc_impl.c \ | |
56 $(SASRCDIR)/ps_core.c \ | |
57 $(SASRCDIR)/MacosxDebuggerLocal.m \ | |
58 $(AGENT_DIR)/src/share/native/sadis.c | |
59 | |
4006 | 60 ifeq ($(OS_VENDOR), FreeBSD) |
8750 | 61 SASRCFILES = $(BSD_NON_STUB_SASRCFILES) |
4006 | 62 SALIBS = -lutil -lthread_db |
63 SAARCH = $(ARCHFLAG) | |
64 else | |
65 ifeq ($(OS_VENDOR), Darwin) | |
8750 | 66 SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES) |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
67 SALIBS = -g \ |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
68 -framework Foundation \ |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
69 -framework JavaNativeFoundation \ |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
70 -framework Security \ |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
71 -framework CoreFoundation |
4006 | 72 #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles? |
73 SAARCH = $(subst -march=i586,,$(ARCHFLAG)) | |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
74 |
23289
7f298e4d1afb
Set SDKROOT in saproc.make if it hasn't been set
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23286
diff
changeset
|
75 ifeq ($(SDKPATH),) |
7f298e4d1afb
Set SDKROOT in saproc.make if it hasn't been set
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23286
diff
changeset
|
76 SDKPATH = $(shell xcrun --show-sdk-path) |
7f298e4d1afb
Set SDKROOT in saproc.make if it hasn't been set
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23286
diff
changeset
|
77 endif |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
78 # This is needed to locate JavaNativeFoundation.framework |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
79 # JDK 8 doesn't have SYSROOT_CFLAGS, so we'll cobble it together here |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
80 SA_SYSROOT_FLAGS= |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
81 ifneq ($(SDKPATH),) |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
82 SA_SYSROOT_FLAGS += -isysroot "$(SDKPATH)" -iframework"$(SDKPATH)/System/Library/Frameworks" |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
83 endif |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
84 # always needed, even if SDKPATH is empty |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
85 SA_SYSROOT_FLAGS += -F"$(SDKPATH)/System/Library/Frameworks/JavaVM.framework/Frameworks" |
4006 | 86 else |
87 SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c | |
88 SALIBS = | |
89 SAARCH = $(ARCHFLAG) | |
90 endif | |
91 endif | |
3960 | 92 |
93 SAMAPFILE = $(SASRCDIR)/mapfile | |
94 | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
95 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
96 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
97 DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ) |
3960 | 98 |
99 # DEBUG_BINARIES overrides everything, use full -g debug information | |
100 ifeq ($(DEBUG_BINARIES), true) | |
101 SA_DEBUG_CFLAGS = -g | |
102 endif | |
103 | |
104 # if $(AGENT_DIR) does not exist, we don't build SA | |
105 # also, we don't build SA on Itanium, PPC, ARM or zero. | |
106 | |
107 ifneq ($(wildcard $(AGENT_DIR)),) | |
108 ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),) | |
109 BUILDLIBSAPROC = $(LIBSAPROC) | |
110 endif | |
111 endif | |
112 | |
113 | |
114 ifneq ($(OS_VENDOR), Darwin) | |
115 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) | |
22887
10c237e58446
8075400: Cannot build hotspot in jdk8u on OSX 10.10 (Yosemite)
ddehaven
parents:
22813
diff
changeset
|
116 else |
10c237e58446
8075400: Cannot build hotspot in jdk8u on OSX 10.10 (Yosemite)
ddehaven
parents:
22813
diff
changeset
|
117 # bring in minimum version argument or we'll fail on OSX 10.10 |
10c237e58446
8075400: Cannot build hotspot in jdk8u on OSX 10.10 (Yosemite)
ddehaven
parents:
22813
diff
changeset
|
118 SA_LFLAGS = $(LFLAGS) |
3960 | 119 endif |
120 SA_LFLAGS += $(LDFLAGS_HASH_STYLE) | |
121 | |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
122 BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ |
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
123 -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") |
4006 | 124 |
3960 | 125 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) |
126 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ | |
127 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ | |
128 exit 1; \ | |
129 fi | |
130 @echo Making SA debugger back-end... | |
131 $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ | |
22813
0e1aa319e805
8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents:
12859
diff
changeset
|
132 $(SA_SYSROOT_FLAGS) \ |
8750 | 133 $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \ |
3960 | 134 -I$(SASRCDIR) \ |
135 -I$(GENERATED) \ | |
4006 | 136 $(BOOT_JAVA_INCLUDES) \ |
3960 | 137 $(SASRCFILES) \ |
138 $(SA_LFLAGS) \ | |
139 $(SA_DEBUG_CFLAGS) \ | |
140 -o $@ \ | |
141 $(SALIBS) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
142 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
143 ifeq ($(OS_VENDOR), Darwin) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
144 $(DSYMUTIL) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
145 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
146 $(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
147 $(RM) -r $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
148 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
149 else |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
150 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
151 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
152 ifeq ($(STRIP_POLICY),all_strip) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
153 $(QUIETLY) $(STRIP) $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
154 else |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
155 ifeq ($(STRIP_POLICY),min_strip) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
156 $(QUIETLY) $(STRIP) -g $@ |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
157 # implied else here is no stripping at all |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
158 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
159 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
160 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
161 $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
162 $(RM) $(LIBSAPROC_DEBUGINFO) |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
163 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
164 endif |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
165 endif |
3960 | 166 |
167 install_saproc: $(BUILDLIBSAPROC) | |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
168 @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" |
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
169 ifeq ($(OS_VENDOR), Darwin) |
18125
2a69cbe850a8
Reduce diff with upstream
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14909
diff
changeset
|
170 $(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \ |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
171 $(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
172 else |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
173 $(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \ |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
174 $(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) |
12859
f509b8f4699b
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
8750
diff
changeset
|
175 endif |
14331
67d6392ed21e
8033714: hotspot 'install_jvm' bld target broken with ZIP_DEBUGINFO_FILES=0
dcubed
parents:
12859
diff
changeset
|
176 $(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \ |
22665
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
177 $(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ) |
d92c9f043d02
import make/bsd/makefiles/saproc.make from graal-jvmci-9
Andreas Woess <andreas.woess@oracle.com>
parents:
18125
diff
changeset
|
178 $(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done" |
3960 | 179 |
180 .PHONY: install_saproc |