83 AS = $(CC) -c
84 endif
85
86 ifeq ($(OS_VENDOR), Darwin)
87 ifeq ($(DSYMUTIL),)
88 DSYMUTIL=dsymutil
89 endif
90 endif
91
92 ifeq ($(USE_CLANG), true)
93 CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
94 CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2)
95 else
96 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
97 # prints the numbers (e.g. "2.95", "3.2.1")
98 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
99 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
100 endif
101
102 ifeq ($(USE_CLANG), true)
103 # clang has precompiled headers support by default, but the user can switch
104 # it off by using 'USE_PRECOMPILED_HEADER=0'.
105 ifdef LP64
106 ifeq ($(USE_PRECOMPILED_HEADER),)
107 USE_PRECOMPILED_HEADER=1
108 endif
109 else
110 # We don't support precompiled headers on 32-bit builds because there some files are
111 # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make)
112 # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit.
113 USE_PRECOMPILED_HEADER=0
114 endif
115
116 ifeq ($(USE_PRECOMPILED_HEADER),1)
117
118 ifndef LP64
119 $(error " Precompiled Headers only supported on 64-bit platforms!")
120 endif
121
122 PRECOMPILED_HEADER_DIR=.
123 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
249 ifneq ($(COMPILER_WARNINGS_FATAL),false)
250 WARNINGS_ARE_ERRORS = -Werror
251 endif
252
253 ifeq ($(USE_CLANG), true)
254 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
255 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
256 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
257 # Not yet supported by clang in Xcode 4.6.2
258 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
259 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
260 WARNINGS_ARE_ERRORS += -Wno-empty-body
261 endif
262
263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
264
265 ifeq ($(USE_CLANG),)
266 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
267 # conversions which might affect the values. Only enable it in earlier versions.
268 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
269 WARNINGS_FLAGS += -Wconversion
270 endif
271 endif
272
273 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
274 # Special cases
275 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
276 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
277 ifeq ($(OS_VENDOR), Darwin)
278 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
279 endif
280
281 OPT_CFLAGS/SIZE=-Os
282 OPT_CFLAGS/SPEED=-O3
283
284 # Hotspot uses very unstrict aliasing turn this optimization off
285 # This option is added to CFLAGS rather than OPT_CFLAGS
286 # so that OPT_CFLAGS overrides get this option too.
287 CFLAGS += -fno-strict-aliasing
288
289 # The flags to use for an Optimized g++ build
290 ifeq ($(OS_VENDOR), Darwin)
291 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
292 # <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
293 OPT_CFLAGS_DEFAULT ?= SIZE
294 else
295 OPT_CFLAGS_DEFAULT ?= SPEED
296 endif
297
298 ifdef OPT_CFLAGS
299 ifneq ("$(origin OPT_CFLAGS)", "command line")
300 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
301 endif
302 endif
303
304 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
305
306 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
307 # if we use expensive-optimizations
308 ifeq ($(BUILDARCH), ia64)
309 OPT_CFLAGS += -fno-expensive-optimizations
310 endif
311
312 OPT_CFLAGS/NOOPT=-O0
313
314 # Work around some compiler bugs.
315 ifeq ($(USE_CLANG), true)
316 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
317 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
318 OPT_CFLAGS/unsafe.o += -O1
319 endif
320 else
321 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
322 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
323 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
324 endif
325 endif
326
327 # Flags for generating make dependency flags.
328 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
329 ifeq ($(USE_CLANG),)
330 ifneq ($(CC_VER_MAJOR), 2)
331 DEPFLAGS += -fpch-deps
332 endif
333 endif
349 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
350 -mmacosx-version-min=$(MACOSX_VERSION_MIN)
351 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
352 endif
353
354
355 #------------------------------------------------------------------------
356 # Assembler flags
357
358 # Enforce prerpocessing of .s files
359 ASFLAGS += -x assembler-with-cpp
360
361 #------------------------------------------------------------------------
362 # Linker flags
363
364 # statically link libstdc++.so, work with gcc but ignored by g++
365 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
366
367 ifeq ($(USE_CLANG),)
368 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
369 ifneq ("${CC_VER_MAJOR}", "2")
370 STATIC_LIBGCC += -static-libgcc
371 endif
372
373 ifeq ($(BUILDARCH), ia64)
374 LFLAGS += -Wl,-relax
375 endif
376 endif
377
378 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
379 MAPFLAG = -Xlinker --version-script=FILENAME
380
381 #
382 # Shared Library
383 #
384 ifeq ($(OS_VENDOR), Darwin)
385 # Standard linker flags
386 LFLAGS +=
387
388 # The apple linker has its own variant of mapfiles/version-scripts
389 MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME
390
391 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
392 SONAMEFLAG =
403 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
404 SONAMEFLAG = -Xlinker -soname=SONAME
405
406 # Build shared library
407 SHARED_FLAG = -shared $(VM_PICFLAG)
408
409 # Keep symbols even they are not used
410 AOUT_FLAGS += -Xlinker -export-dynamic
411 endif
412
413 #------------------------------------------------------------------------
414 # Debug flags
415
416 ifeq ($(USE_CLANG), true)
417 # Restrict the debug information created by Clang to avoid
418 # too big object files and speed the build up a little bit
419 # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
420 CFLAGS += -flimit-debug-info
421 endif
422
423 # DEBUG_BINARIES uses full -g debug information for all configs
424 ifeq ($(DEBUG_BINARIES), true)
425 CFLAGS += -g
426 else
427 # Use the stabs format for debugging information (this is the default
428 # on gcc-2.91). It's good enough, has all the information about line
429 # numbers and local variables, and libjvm.so is only about 16M.
430 # Change this back to "-g" if you want the most expressive format.
431 # (warning: that could easily inflate libjvm.so to 150M!)
432 # Note: The Itanium gcc compiler crashes when using -gstabs.
433 DEBUG_CFLAGS/ia64 = -g
434 DEBUG_CFLAGS/amd64 = -g
435 DEBUG_CFLAGS/arm = -g
436 DEBUG_CFLAGS/ppc = -g
437 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
438 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
439 DEBUG_CFLAGS += -gstabs
440 endif
441
442 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
443 FASTDEBUG_CFLAGS/ia64 = -g
444 FASTDEBUG_CFLAGS/amd64 = -g
445 FASTDEBUG_CFLAGS/arm = -g
446 FASTDEBUG_CFLAGS/ppc = -g
447 FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH))
448 ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
449 ifeq ($(USE_CLANG), true)
450 # Clang doesn't understand -gstabs
451 FASTDEBUG_CFLAGS += -g
452 else
453 FASTDEBUG_CFLAGS += -gstabs
454 endif
455 endif
456
457 OPT_CFLAGS/ia64 = -g
458 OPT_CFLAGS/amd64 = -g
459 OPT_CFLAGS/arm = -g
460 OPT_CFLAGS/ppc = -g
461 OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
462 ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
463 ifeq ($(USE_CLANG), true)
464 # Clang doesn't understand -gstabs
465 OPT_CFLAGS += -g
466 else
467 OPT_CFLAGS += -gstabs
468 endif
469 endif
470 endif
471 endif
472
473 # If we are building HEADLESS, pass on to VM
474 # so it can set the java.awt.headless property
475 ifdef HEADLESS
476 CFLAGS += -DHEADLESS
477 endif
478
479 # We are building Embedded for a small device
480 # favor code space over speed
481 ifdef MINIMIZE_RAM_USAGE
482 CFLAGS += -DMINIMIZE_RAM_USAGE
483 endif
|
83 AS = $(CC) -c
84 endif
85
86 ifeq ($(OS_VENDOR), Darwin)
87 ifeq ($(DSYMUTIL),)
88 DSYMUTIL=dsymutil
89 endif
90 endif
91
92 ifeq ($(USE_CLANG), true)
93 CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
94 CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2)
95 else
96 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
97 # prints the numbers (e.g. "2.95", "3.2.1")
98 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
99 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
100 endif
101
102 ifeq ($(USE_CLANG), true)
103 # Clang has precompiled headers support by default, but the user can switch
104 # it off by using 'USE_PRECOMPILED_HEADER=0'.
105 ifdef LP64
106 ifeq ($(USE_PRECOMPILED_HEADER),)
107 USE_PRECOMPILED_HEADER=1
108 endif
109 else
110 # We don't support precompiled headers on 32-bit builds because there some files are
111 # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make)
112 # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit.
113 USE_PRECOMPILED_HEADER=0
114 endif
115
116 ifeq ($(USE_PRECOMPILED_HEADER),1)
117
118 ifndef LP64
119 $(error " Precompiled Headers only supported on 64-bit platforms!")
120 endif
121
122 PRECOMPILED_HEADER_DIR=.
123 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
249 ifneq ($(COMPILER_WARNINGS_FATAL),false)
250 WARNINGS_ARE_ERRORS = -Werror
251 endif
252
253 ifeq ($(USE_CLANG), true)
254 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
255 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
256 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
257 # Not yet supported by clang in Xcode 4.6.2
258 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
259 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
260 WARNINGS_ARE_ERRORS += -Wno-empty-body
261 endif
262
263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
264
265 ifeq ($(USE_CLANG),)
266 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
267 # conversions which might affect the values. Only enable it in earlier versions.
268 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
269 WARNING_FLAGS += -Wconversion
270 endif
271 endif
272
273 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
274 # Special cases
275 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
276 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
277 ifeq ($(OS_VENDOR), Darwin)
278 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
279 endif
280
281 # optimization control flags (Used by fastdebug and release variants)
282 OPT_CFLAGS/NOOPT=-O0
283 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
284 # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
285 OPT_CFLAGS/DEBUG=-Og
286 else
287 # Allow no optimizations.
288 OPT_CFLAGS/DEBUG=-O0
289 endif
290 OPT_CFLAGS/SIZE=-Os
291 OPT_CFLAGS/SPEED=-O3
292
293 ifeq ($(OS_VENDOR), Darwin)
294 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
295 # <https://wiki.openjdk.java.net/display/MacOSXPort/Compiler+Errata>
296 OPT_CFLAGS_DEFAULT ?= SIZE
297 else
298 OPT_CFLAGS_DEFAULT ?= SPEED
299 endif
300
301 # Hotspot uses very unstrict aliasing turn this optimization off
302 # This option is added to CFLAGS rather than OPT_CFLAGS
303 # so that OPT_CFLAGS overrides get this option too.
304 CFLAGS += -fno-strict-aliasing
305
306 ifdef OPT_CFLAGS
307 ifneq ("$(origin OPT_CFLAGS)", "command line")
308 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
309 endif
310 endif
311
312 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
313
314 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
315 # if we use expensive-optimizations
316 ifeq ($(BUILDARCH), ia64)
317 OPT_CFLAGS += -fno-expensive-optimizations
318 endif
319
320 # Work around some compiler bugs.
321 ifeq ($(USE_CLANG), true)
322 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
323 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
324 OPT_CFLAGS/unsafe.o += -O1
325 endif
326 else
327 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
328 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
329 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
330 endif
331 endif
332
333 # Flags for generating make dependency flags.
334 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
335 ifeq ($(USE_CLANG),)
336 ifneq ($(CC_VER_MAJOR), 2)
337 DEPFLAGS += -fpch-deps
338 endif
339 endif
355 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
356 -mmacosx-version-min=$(MACOSX_VERSION_MIN)
357 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
358 endif
359
360
361 #------------------------------------------------------------------------
362 # Assembler flags
363
364 # Enforce prerpocessing of .s files
365 ASFLAGS += -x assembler-with-cpp
366
367 #------------------------------------------------------------------------
368 # Linker flags
369
370 # statically link libstdc++.so, work with gcc but ignored by g++
371 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
372
373 ifeq ($(USE_CLANG),)
374 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
375 ifneq ($(CC_VER_MAJOR), 2)
376 STATIC_LIBGCC += -static-libgcc
377 endif
378
379 # Enable linker optimization
380 LFLAGS += -Xlinker -O1
381
382 ifeq ($(VARIANT), DBG)
383 # for relocations read-only
384 LFLAGS += -Wl,-z,relro
385
386 ifeq ($(FASTDEBUG), false)
387 # disable incremental relocations linking
388 LFLAGS += -Wl,-z,now
389 endif
390 endif
391
392 ifeq ($(BUILDARCH), ia64)
393 LFLAGS += -Wl,-relax
394 endif
395 endif
396
397 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
398 MAPFLAG = -Xlinker --version-script=FILENAME
399
400 #
401 # Shared Library
402 #
403 ifeq ($(OS_VENDOR), Darwin)
404 # Standard linker flags
405 LFLAGS +=
406
407 # The apple linker has its own variant of mapfiles/version-scripts
408 MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME
409
410 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
411 SONAMEFLAG =
422 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
423 SONAMEFLAG = -Xlinker -soname=SONAME
424
425 # Build shared library
426 SHARED_FLAG = -shared $(VM_PICFLAG)
427
428 # Keep symbols even they are not used
429 AOUT_FLAGS += -Xlinker -export-dynamic
430 endif
431
432 #------------------------------------------------------------------------
433 # Debug flags
434
435 ifeq ($(USE_CLANG), true)
436 # Restrict the debug information created by Clang to avoid
437 # too big object files and speed the build up a little bit
438 # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
439 CFLAGS += -flimit-debug-info
440 endif
441
442 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
443 # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
444 DEBUG_CFLAGS=-Og
445 else
446 # Allow no optimizations.
447 DEBUG_CFLAGS=-O0
448 endif
449
450 # DEBUG_BINARIES uses full -g debug information for all configs
451 ifeq ($(DEBUG_BINARIES), true)
452 CFLAGS += -g
453 else
454 # Use the stabs format for debugging information (this is the default
455 # on gcc-2.91). It's good enough, has all the information about line
456 # numbers and local variables, and libjvm.so is only about 16M.
457 # Change this back to "-g" if you want the most expressive format.
458 # (warning: that could easily inflate libjvm.so to 150M!)
459 # Note: The Itanium gcc compiler crashes when using -gstabs.
460 DEBUG_CFLAGS/ia64 = -g
461 DEBUG_CFLAGS/amd64 = -g
462 DEBUG_CFLAGS/arm = -g
463 DEBUG_CFLAGS/ppc = -g
464 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
465 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
466 ifeq ($(USE_CLANG), true)
467 # Clang doesn't understand -gstabs
468 DEBUG_CFLAGS += -g
469 else
470 DEBUG_CFLAGS += -gstabs
471 endif
472 endif
473
474 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
475 FASTDEBUG_CFLAGS/ia64 = -g
476 FASTDEBUG_CFLAGS/amd64 = -g
477 FASTDEBUG_CFLAGS/arm = -g
478 FASTDEBUG_CFLAGS/ppc = -g
479 FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH))
480 ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
481 ifeq ($(USE_CLANG), true)
482 # Clang doesn't understand -gstabs
483 FASTDEBUG_CFLAGS += -g
484 else
485 FASTDEBUG_CFLAGS += -gstabs
486 endif
487 endif
488
489 OPT_CFLAGS/ia64 = -g
490 OPT_CFLAGS/amd64 = -g
491 OPT_CFLAGS/arm = -g
492 OPT_CFLAGS/ppc = -g
493 OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
494 ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
495 ifeq ($(USE_CLANG), true)
496 # Clang doesn't understand -gstabs
497 OPT_CFLAGS += -g
498 else
499 OPT_CFLAGS += -gstabs
500 endif
501 endif
502 endif
503 endif
504
505 # Enable bounds checking.
506 ifeq ($(VARIANT), DBG)
507 # _FORTIFY_SOURCE appears in GCC 4.0+
508 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) )" "0"
509 ifeq ($(FASTDEBUG), true)
510 # compile time size bounds checks
511 CFLAGS += -D_FORTIFY_SOURCE=1
512 else
513 # and runtime size bounds checks and paranoid stack smashing checks.
514 CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1
515 endif
516 endif
517 endif
518
519 # If we are building HEADLESS, pass on to VM
520 # so it can set the java.awt.headless property
521 ifdef HEADLESS
522 CFLAGS += -DHEADLESS
523 endif
524
525 # We are building Embedded for a small device
526 # favor code space over speed
527 ifdef MINIMIZE_RAM_USAGE
528 CFLAGS += -DMINIMIZE_RAM_USAGE
529 endif
|