comparison make/linux/makefiles/gcc.make @ 1681:126ea7725993

6953477: Increase portability and flexibility of building Hotspot Summary: A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail. Reviewed-by: phh, never, coleenp, dholmes
author bobv
date Tue, 03 Aug 2010 08:13:38 -0400
parents c18cbe5936b8
children d2ede61b7a12
comparison
equal deleted inserted replaced
1680:a64438a2b7e8 1681:126ea7725993
23 # 23 #
24 24
25 #------------------------------------------------------------------------ 25 #------------------------------------------------------------------------
26 # CC, CPP & AS 26 # CC, CPP & AS
27 27
28 ifdef ALT_COMPILER_PATH
29 CPP = $(ALT_COMPILER_PATH)/g++
30 CC = $(ALT_COMPILER_PATH)/gcc
31 else
28 CPP = g++ 32 CPP = g++
29 CC = gcc 33 CC = gcc
34 endif
35
30 AS = $(CC) -c 36 AS = $(CC) -c
31 37
32 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only 38 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
33 # prints the numbers (e.g. "2.95", "3.2.1") 39 # prints the numbers (e.g. "2.95", "3.2.1")
34 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) 40 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
65 ARCHFLAG/i486 = -m32 -march=i586 71 ARCHFLAG/i486 = -m32 -march=i586
66 ARCHFLAG/amd64 = -m64 72 ARCHFLAG/amd64 = -m64
67 ARCHFLAG/ia64 = 73 ARCHFLAG/ia64 =
68 ARCHFLAG/sparc = -m32 -mcpu=v9 74 ARCHFLAG/sparc = -m32 -mcpu=v9
69 ARCHFLAG/sparcv9 = -m64 -mcpu=v9 75 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
76 ARCHFLAG/arm = -fsigned-char
70 ARCHFLAG/zero = $(ZERO_ARCHFLAG) 77 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
78 ifndef E500V2
79 ARCHFLAG/ppc = -mcpu=powerpc
80 endif
71 81
72 CFLAGS += $(ARCHFLAG) 82 CFLAGS += $(ARCHFLAG)
73 AOUT_FLAGS += $(ARCHFLAG) 83 AOUT_FLAGS += $(ARCHFLAG)
74 LFLAGS += $(ARCHFLAG) 84 LFLAGS += $(ARCHFLAG)
75 ASFLAGS += $(ARCHFLAG) 85 ASFLAGS += $(ARCHFLAG)
76 86
87 ifdef E500V2
88 CFLAGS += -DE500V2
89 endif
90
77 # Use C++ Interpreter 91 # Use C++ Interpreter
78 ifdef CC_INTERP 92 ifdef CC_INTERP
79 CFLAGS += -DCC_INTERP 93 CFLAGS += -DCC_INTERP
94 endif
95
96 # Build for embedded targets
97 ifdef JAVASE_EMBEDDED
98 CFLAGS += -DJAVASE_EMBEDDED
80 endif 99 endif
81 100
82 # Keep temporary files (.ii, .s) 101 # Keep temporary files (.ii, .s)
83 ifdef NEED_ASM 102 ifdef NEED_ASM
84 CFLAGS += -save-temps 103 CFLAGS += -save-temps
169 # Change this back to "-g" if you want the most expressive format. 188 # Change this back to "-g" if you want the most expressive format.
170 # (warning: that could easily inflate libjvm_g.so to 150M!) 189 # (warning: that could easily inflate libjvm_g.so to 150M!)
171 # Note: The Itanium gcc compiler crashes when using -gstabs. 190 # Note: The Itanium gcc compiler crashes when using -gstabs.
172 DEBUG_CFLAGS/ia64 = -g 191 DEBUG_CFLAGS/ia64 = -g
173 DEBUG_CFLAGS/amd64 = -g 192 DEBUG_CFLAGS/amd64 = -g
193 DEBUG_CFLAGS/arm = -g
194 DEBUG_CFLAGS/ppc = -g
174 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) 195 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
175 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) 196 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
176 DEBUG_CFLAGS += -gstabs 197 DEBUG_CFLAGS += -gstabs
177 endif 198 endif
178 199
179 # DEBUG_BINARIES overrides everything, use full -g debug information 200 # DEBUG_BINARIES overrides everything, use full -g debug information
180 ifeq ($(DEBUG_BINARIES), true) 201 ifeq ($(DEBUG_BINARIES), true)
181 DEBUG_CFLAGS = -g 202 DEBUG_CFLAGS = -g
182 CFLAGS += $(DEBUG_CFLAGS) 203 CFLAGS += $(DEBUG_CFLAGS)
183 endif 204 endif
205
206 # If we are building HEADLESS, pass on to VM
207 # so it can set the java.awt.headless property
208 ifdef HEADLESS
209 CFLAGS += -DHEADLESS
210 endif
211
212 # We are building Embedded for a small device
213 # favor code space over speed
214 ifdef MINIMIZE_RAM_USAGE
215 CFLAGS += -DMINIMIZE_RAM_USAGE
216 endif