core: Don't debug native modules when TARGET_BUILD_TYPE==debug

Don't make the simulator default to debug mode.

Remove all global "debug" {C,CPP}FLAGS, which are no longer used.
This commit is contained in:
Dave Bort 2009-04-23 18:44:55 -07:00
parent 6062815e2e
commit 952824843b
5 changed files with 33 additions and 54 deletions

View File

@ -47,11 +47,11 @@ LOCAL_ARM_MODE := $(strip $(LOCAL_ARM_MODE))
arm_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),arm) arm_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),arm)
normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb) normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb)
# Read the values from something like TARGET_arm_release_CFLAGS or # Read the values from something like TARGET_arm_CFLAGS or
# TARGET_thumb_debug_CFLAGS. HOST_(arm|thumb)_(release|debug)_CFLAGS # TARGET_thumb_CFLAGS. HOST_(arm|thumb)_CFLAGS values aren't
# values aren't actually used (although they are usually empty). # actually used (although they are usually empty).
arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_$($(my_prefix)BUILD_TYPE)_CFLAGS) arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_CFLAGS)
normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_$($(my_prefix)BUILD_TYPE)_CFLAGS) normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_CFLAGS)
########################################################### ###########################################################
## Define per-module debugging flags. Users can turn on ## Define per-module debugging flags. Users can turn on

View File

@ -15,32 +15,31 @@ $(combo_target)LD := $($(combo_target)TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX)
$(combo_target)NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined $(combo_target)NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
TARGET_arm_release_CFLAGS := -O2 \ TARGET_arm_CFLAGS := -O2 \
-fomit-frame-pointer \ -fomit-frame-pointer \
-fstrict-aliasing \ -fstrict-aliasing \
-funswitch-loops \ -funswitch-loops \
-finline-limit=300 -finline-limit=300
TARGET_thumb_release_CFLAGS := -mthumb \ TARGET_thumb_CFLAGS := -mthumb \
-Os \ -Os \
-fomit-frame-pointer \ -fomit-frame-pointer \
-fno-strict-aliasing \ -fno-strict-aliasing \
-finline-limit=64 -finline-limit=64
# When building for debug, compile everything as arm. # Set FORCE_ARM_DEBUGGING to "true" in your buildspec.mk
TARGET_arm_debug_CFLAGS := $(TARGET_arm_release_CFLAGS) -fno-omit-frame-pointer -fno-strict-aliasing # or in your environment to force a full arm build, even for
TARGET_thumb_debug_CFLAGS := $(TARGET_thumb_release_CFLAGS) -marm -fno-omit-frame-pointer # files that are normally built as thumb; this can make
# gdb debugging easier. Don't forget to do a clean build.
# NOTE: if you try to build a debug build with thumb, several #
# NOTE: if you try to build a -O0 build with thumb, several
# of the libraries (libpv, libwebcore, libkjs) need to be built # of the libraries (libpv, libwebcore, libkjs) need to be built
# with -mlong-calls. When built at -O0, those libraries are # with -mlong-calls. When built at -O0, those libraries are
# too big for a thumb "BL <label>" to go from one end to the other. # too big for a thumb "BL <label>" to go from one end to the other.
ifeq ($(FORCE_ARM_DEBUGGING),true)
## As hopefully a temporary hack, TARGET_arm_CFLAGS += -fno-omit-frame-pointer
## use this to force a full ARM build (for easier debugging in gdb) TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
## (don't forget to do a clean build) endif
##TARGET_arm_release_CFLAGS := $(TARGET_arm_release_CFLAGS) -fno-omit-frame-pointer
##TARGET_thumb_release_CFLAGS := $(TARGET_thumb_release_CFLAGS) -marm -fno-omit-frame-pointer
## on some hosts, the target cross-compiler is not available so do not run this command ## on some hosts, the target cross-compiler is not available so do not run this command
ifneq ($(wildcard $($(combo_target)CC)),) ifneq ($(wildcard $($(combo_target)CC)),)

View File

@ -7,7 +7,6 @@
# $(combo_target)OS -- standard name for this host (LINUX, DARWIN, etc.) # $(combo_target)OS -- standard name for this host (LINUX, DARWIN, etc.)
# $(combo_target)ARCH -- standard name for process architecture (powerpc, x86, etc.) # $(combo_target)ARCH -- standard name for process architecture (powerpc, x86, etc.)
# $(combo_target)GLOBAL_CFLAGS -- C compiler flags to use for everything # $(combo_target)GLOBAL_CFLAGS -- C compiler flags to use for everything
# $(combo_target)DEBUG_CFLAGS -- additional C compiler flags for debug builds
# $(combo_target)RELEASE_CFLAGS -- additional C compiler flags for release builds # $(combo_target)RELEASE_CFLAGS -- additional C compiler flags for release builds
# $(combo_target)GLOBAL_ARFLAGS -- flags to use for static linking everything # $(combo_target)GLOBAL_ARFLAGS -- flags to use for static linking everything
# $(combo_target)SHLIB_SUFFIX -- suffix of shared libraries # $(combo_target)SHLIB_SUFFIX -- suffix of shared libraries
@ -39,7 +38,6 @@ $(combo_target)HAVE_KERNEL_MODULES := 0
# These flags might (will) be overridden by the target makefiles # These flags might (will) be overridden by the target makefiles
$(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar $(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
$(combo_target)DEBUG_CFLAGS := -O0 -g
$(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing $(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
$(combo_target)GLOBAL_ARFLAGS := crs $(combo_target)GLOBAL_ARFLAGS := crs

View File

@ -76,11 +76,9 @@ SHOW_COMMANDS:= $(filter showcommands,$(MAKECMDGOALS))
# These can be changed to modify both host and device modules. # These can be changed to modify both host and device modules.
COMMON_GLOBAL_CFLAGS:= -DANDROID -fmessage-length=0 -W -Wall -Wno-unused COMMON_GLOBAL_CFLAGS:= -DANDROID -fmessage-length=0 -W -Wall -Wno-unused
COMMON_DEBUG_CFLAGS:=
COMMON_RELEASE_CFLAGS:= -DNDEBUG -UDEBUG COMMON_RELEASE_CFLAGS:= -DNDEBUG -UDEBUG
COMMON_GLOBAL_CPPFLAGS:= COMMON_GLOBAL_CPPFLAGS:=
COMMON_DEBUG_CPPFLAGS:=
COMMON_RELEASE_CPPFLAGS:= COMMON_RELEASE_CPPFLAGS:=
# Set the extensions used for various packages # Set the extensions used for various packages
@ -227,19 +225,15 @@ endif
# ############################################################### # ###############################################################
HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS) HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
HOST_DEBUG_CFLAGS += $(COMMON_DEBUG_CFLAGS)
HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS) HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS) HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
HOST_DEBUG_CPPFLAGS += $(COMMON_DEBUG_CPPFLAGS)
HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS) HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS) TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
TARGET_DEBUG_CFLAGS += $(COMMON_DEBUG_CFLAGS)
TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS) TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
TARGET_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS) TARGET_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
TARGET_DEBUG_CPPFLAGS += $(COMMON_DEBUG_CPPFLAGS)
TARGET_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS) TARGET_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
HOST_GLOBAL_LD_DIRS += -L$(HOST_OUT_INTERMEDIATE_LIBRARIES) HOST_GLOBAL_LD_DIRS += -L$(HOST_OUT_INTERMEDIATE_LIBRARIES)
@ -250,7 +244,7 @@ TARGET_PROJECT_INCLUDES:= $(SRC_HEADERS) $(TARGET_OUT_HEADERS)
# Many host compilers don't support these flags, so we have to make # Many host compilers don't support these flags, so we have to make
# sure to only specify them for the target compilers checked in to # sure to only specify them for the target compilers checked in to
# the source tree. The simulator uses the target flags but the # the source tree. The simulator passes the target flags to the
# host compiler, so only set them for the target when the target # host compiler, so only set them for the target when the target
# is not the simulator. # is not the simulator.
ifneq ($(TARGET_SIMULATOR),true) ifneq ($(TARGET_SIMULATOR),true)
@ -258,21 +252,11 @@ TARGET_GLOBAL_CFLAGS += $(TARGET_ERROR_FLAGS)
TARGET_GLOBAL_CPPFLAGS += $(TARGET_ERROR_FLAGS) TARGET_GLOBAL_CPPFLAGS += $(TARGET_ERROR_FLAGS)
endif endif
ifeq ($(HOST_BUILD_TYPE),release) HOST_GLOBAL_CFLAGS += $(HOST_RELEASE_CFLAGS)
HOST_GLOBAL_CFLAGS+= $(HOST_RELEASE_CFLAGS) HOST_GLOBAL_CPPFLAGS += $(HOST_RELEASE_CPPFLAGS)
HOST_GLOBAL_CPPFLAGS+= $(HOST_RELEASE_CPPFLAGS)
else
HOST_GLOBAL_CFLAGS+= $(HOST_DEBUG_CFLAGS)
HOST_GLOBAL_CPPFLAGS+= $(HOST_DEBUG_CPPFLAGS)
endif
ifeq ($(TARGET_BUILD_TYPE),release) TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS)
TARGET_GLOBAL_CFLAGS+= $(TARGET_RELEASE_CFLAGS) TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS)
TARGET_GLOBAL_CPPFLAGS+= $(TARGET_RELEASE_CPPFLAGS)
else
TARGET_GLOBAL_CFLAGS+= $(TARGET_DEBUG_CFLAGS)
TARGET_GLOBAL_CPPFLAGS+= $(TARGET_DEBUG_CPPFLAGS)
endif
# TODO: do symbol compression # TODO: do symbol compression
TARGET_COMPRESS_MODULE_SYMBOLS := false TARGET_COMPRESS_MODULE_SYMBOLS := false

View File

@ -256,13 +256,11 @@ PRODUCT_OTA_PUBLIC_KEYS := $(sort \
$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS)) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_PUBLIC_KEYS))
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Force the simulator to be the simulator, and make BUILD_TYPE # Simulator overrides
# default to debug.
ifeq ($(TARGET_PRODUCT),sim) ifeq ($(TARGET_PRODUCT),sim)
# Tell the build system to turn on some special cases
# to deal with the simulator product.
TARGET_SIMULATOR := true TARGET_SIMULATOR := true
ifeq (,$(strip $(TARGET_BUILD_TYPE)))
TARGET_BUILD_TYPE := debug
endif
# dexpreopt doesn't work when building the simulator # dexpreopt doesn't work when building the simulator
DISABLE_DEXPREOPT := true DISABLE_DEXPREOPT := true
endif endif