1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
$NetBSD: patch-hotspot_make_solaris_makefiles_gcc.make,v 1.1 2015/07/03 20:40:59 fhajny Exp $
GCC support.
--- hotspot/make/solaris/makefiles/gcc.make.orig 2015-02-02 15:32:37.000000000 +0000
+++ hotspot/make/solaris/makefiles/gcc.make
@@ -70,11 +70,23 @@ VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT =
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
+ifeq ($(JVM_VARIANT_ZERO), true)
+ CFLAGS += $(LIBFFI_CFLAGS)
+endif
+ifeq ($(JVM_VARIANT_ZEROSHARK), true)
+ CFLAGS += $(LIBFFI_CFLAGS)
+ CFLAGS += $(LLVM_CFLAGS)
+endif
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions
CFLAGS += -D_REENTRANT
CFLAGS += -fcheck-new
+# version 4 and above support fvisibility=hidden (matches jni_x86.h file)
+# except 4.1.2 gives pointless warnings that can't be disabled (afaik)
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ CFLAGS += -fvisibility=hidden
+endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
@@ -86,7 +98,8 @@ ARCHFLAG/amd64 = -m64 -march=k8
# Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
ISA_DIR=$(ISA_DIR/$(BUILDARCH))
-ISA_DIR/amd64=/amd64
+ISA_DIR/amd64=
+NOMULTIARCHISA_DIR/amd64=/amd64
ISA_DIR/i486=
ISA_DIR/sparcv9=/64
@@ -94,7 +107,6 @@
CFLAGS += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LFLAGS += $(ARCHFLAG)
-ASFLAGS += $(ARCHFLAG)
ifeq ($(BUILDARCH), amd64)
ASFLAGS += -march=k8 -march=amd64
@@ -107,6 +119,11 @@ ifdef CC_INTERP
CFLAGS += -DCC_INTERP
endif
+# Build for embedded targets
+ifdef JAVASE_EMBEDDED
+ CFLAGS += -DJAVASE_EMBEDDED
+endif
+
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -117,9 +134,18 @@ endif
# Compiler warnings are treated as errors
WARNINGS_ARE_ERRORS = -Werror
-# Enable these warnings. See 'info gcc' about details on these options
-WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
-CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
+
+# Except for a few acceptable ones
+# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+# conversions which might affect the values. To avoid that, we need to turn
+# it off explicitly.
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
+else
+ ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
+endif
+
+CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
# Special cases
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
@@ -177,7 +203,7 @@ MAPFLAG = -Xlinker -M -Xlinker FILENAME
endif
# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
-SONAMEFLAG = -Xlinker -soname=SONAME
+SONAMEFLAG = -Wl,-soname=SONAME
# Build shared library
SHARED_FLAG = -shared
@@ -185,15 +211,32 @@ SHARED_FLAG = -shared
#------------------------------------------------------------------------
# Debug flags
-# Use the stabs format for debugging information (this is the default
-# on gcc-2.91). It's good enough, has all the information about line
-# numbers and local variables, and libjvm.so is only about 16M.
-# Change this back to "-g" if you want the most expressive format.
-# (warning: that could easily inflate libjvm.so to 150M!)
-# Note: The Itanium gcc compiler crashes when using -gstabs.
-DEBUG_CFLAGS/ia64 = -g
-DEBUG_CFLAGS/amd64 = -g
-DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
-ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
-DEBUG_CFLAGS += -gstabs
-endif
+# DEBUG_BINARIES uses full -g debug information for all configs
+ifeq ($(DEBUG_BINARIES), true)
+ CFLAGS += -g
+else
+# Use the stabs format for debugging information (this is the default
+# on gcc-2.91). It's good enough, has all the information about line
+# numbers and local variables, and libjvm_g.so is only about 16M.
+# Change this back to "-g" if you want the most expressive format.
+# (warning: that could easily inflate libjvm_g.so to 150M!)
+# Note: The Itanium gcc compiler crashes when using -gstabs.
+DEBUG_CFLAGS/ia64 = -g
+DEBUG_CFLAGS/amd64 = -g
+DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
+ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
+DEBUG_CFLAGS += -gstabs
+endif
+endif
+
+# If we are building HEADLESS, pass on to VM
+# so it can set the java.awt.headless property
+ifdef HEADLESS
+ CFLAGS += -DHEADLESS
+endif
+
+# We are building Embedded for a small device
+# favor code space over speed
+ifdef MINIMIZE_RAM_USAGE
+ CFLAGS += -DMINIMIZE_RAM_USAGE
+endif
|