1 #
2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
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 #
159 CFLAGS += -fvisibility=hidden
160 endif
161
162 ifeq ($(USE_CLANG), true)
163 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
164 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
165 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
166 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
167 else
168 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
169 endif
170 endif
171
172 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
173 ARCHFLAG/i486 = -m32 -march=i586
174 ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
175 ARCHFLAG/aarch64 =
176 ARCHFLAG/ia64 =
177 ARCHFLAG/sparc = -m32 -mcpu=v9
178 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
179 ARCHFLAG/arm = -fsigned-char
180 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
181 ifndef E500V2
182 ARCHFLAG/ppc = -mcpu=powerpc
183 endif
184 ARCHFLAG/ppc64 = -m64
185
186 CFLAGS += $(ARCHFLAG)
187 AOUT_FLAGS += $(ARCHFLAG)
188 LFLAGS += $(ARCHFLAG)
189 ASFLAGS += $(ARCHFLAG)
190
191 ifdef E500V2
192 CFLAGS += -DE500V2
193 endif
194
195 # Use C++ Interpreter
196 ifdef CC_INTERP
197 CFLAGS += -DCC_INTERP
198 endif
199
200 # Keep temporary files (.ii, .s)
201 ifdef NEED_ASM
202 CFLAGS += -save-temps
203 else
204 CFLAGS += -pipe
205 endif
206
207 # Compiler warnings are treated as errors
208 WARNINGS_ARE_ERRORS = -Werror
209
210 ifeq ($(USE_CLANG), true)
211 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
212 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
213 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
214 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
374
375
376 # If we are building HEADLESS, pass on to VM
377 # so it can set the java.awt.headless property
378 ifdef HEADLESS
379 CFLAGS += -DHEADLESS
380 endif
381
382 # We are building Embedded for a small device
383 # favor code space over speed
384 ifdef MINIMIZE_RAM_USAGE
385 CFLAGS += -DMINIMIZE_RAM_USAGE
386 endif
387
388 # Stack walking in the JVM relies on frame pointer (%rbp) to walk thread stack.
389 # Explicitly specify -fno-omit-frame-pointer because it is off by default
390 # starting with gcc 4.6.
391 ifndef USE_SUNCC
392 CFLAGS += -fno-omit-frame-pointer
393 endif
|
1 #
2 # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
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 #
159 CFLAGS += -fvisibility=hidden
160 endif
161
162 ifeq ($(USE_CLANG), true)
163 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
164 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
165 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
166 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
167 else
168 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
169 endif
170 endif
171
172 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
173 ARCHFLAG/i486 = -m32 -march=i586
174 ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
175 ARCHFLAG/aarch64 =
176 ARCHFLAG/ia64 =
177 ARCHFLAG/sparc = -m32 -mcpu=v9
178 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
179 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
180 ARCHFLAG/ppc64 = -m64
181
182 CFLAGS += $(ARCHFLAG)
183 AOUT_FLAGS += $(ARCHFLAG)
184 LFLAGS += $(ARCHFLAG)
185 ASFLAGS += $(ARCHFLAG)
186
187 # Use C++ Interpreter
188 ifdef CC_INTERP
189 CFLAGS += -DCC_INTERP
190 endif
191
192 # Keep temporary files (.ii, .s)
193 ifdef NEED_ASM
194 CFLAGS += -save-temps
195 else
196 CFLAGS += -pipe
197 endif
198
199 # Compiler warnings are treated as errors
200 WARNINGS_ARE_ERRORS = -Werror
201
202 ifeq ($(USE_CLANG), true)
203 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
204 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
205 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
206 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
366
367
368 # If we are building HEADLESS, pass on to VM
369 # so it can set the java.awt.headless property
370 ifdef HEADLESS
371 CFLAGS += -DHEADLESS
372 endif
373
374 # We are building Embedded for a small device
375 # favor code space over speed
376 ifdef MINIMIZE_RAM_USAGE
377 CFLAGS += -DMINIMIZE_RAM_USAGE
378 endif
379
380 # Stack walking in the JVM relies on frame pointer (%rbp) to walk thread stack.
381 # Explicitly specify -fno-omit-frame-pointer because it is off by default
382 # starting with gcc 4.6.
383 ifndef USE_SUNCC
384 CFLAGS += -fno-omit-frame-pointer
385 endif
386
387 -include $(HS_ALT_MAKE)/linux/makefiles/gcc.make
|