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