forked from openkylin/platform_build
Don't include system/core/include/arch/<arch>/Android.mk for apps-only build.
Bug: 6994483 Change-Id: I76c4d96264cf94a79d59fdeb52bb37c07a9458dd
This commit is contained in:
parent
bc415dd5eb
commit
da4bf42514
|
@ -161,31 +161,29 @@ LOCAL_ASFLAGS += -D__ASSEMBLY__
|
||||||
###########################################################
|
###########################################################
|
||||||
## Define PRIVATE_ variables from global vars
|
## Define PRIVATE_ variables from global vars
|
||||||
###########################################################
|
###########################################################
|
||||||
ifeq ($(strip $(LOCAL_CLANG)),true)
|
|
||||||
my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
|
|
||||||
else
|
|
||||||
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef LOCAL_SDK_VERSION
|
ifdef LOCAL_SDK_VERSION
|
||||||
my_target_project_includes :=
|
my_target_project_includes :=
|
||||||
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
|
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
|
||||||
# TODO: more reliable way to remove platform stuff.
|
|
||||||
my_target_global_cflags := $(filter-out -include -I system/%, $(my_target_global_cflags))
|
# filter out including of AndroidConfig.h in system/core.
|
||||||
my_target_global_cppflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CPPFLAGS))
|
TARGET_GLOBAL_CFLAGS_NO_ANDCONF ?= $(subst $(TARGET_ANDROID_CONFIG_CFLAGS),,\
|
||||||
|
$(TARGET_GLOBAL_CFLAGS))
|
||||||
|
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS_NO_ANDCONF)
|
||||||
else
|
else
|
||||||
my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
|
my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
|
||||||
my_target_c_includes := $(TARGET_C_INCLUDES)
|
my_target_c_includes := $(TARGET_C_INCLUDES)
|
||||||
my_target_global_cflags := $(my_target_global_cflags)
|
|
||||||
my_target_global_cppflags := $(TARGET_GLOBAL_CPPFLAGS)
|
|
||||||
ifeq ($(strip $(LOCAL_CLANG)),true)
|
ifeq ($(strip $(LOCAL_CLANG)),true)
|
||||||
my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
|
my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
|
||||||
endif
|
my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
|
||||||
endif
|
else
|
||||||
|
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
|
||||||
|
endif # LOCAL_CLANG
|
||||||
|
endif # LOCAL_SDK_VERSION
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(my_target_global_cppflags)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(TARGET_GLOBAL_CPPFLAGS)
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## Define PRIVATE_ variables used by multiple module types
|
## Define PRIVATE_ variables used by multiple module types
|
||||||
|
|
|
@ -64,8 +64,10 @@ HOST_STRIP_COMMAND = $(HOST_STRIP) --strip-debug $< -o $@
|
||||||
HOST_SHLIB_SUFFIX := .dylib
|
HOST_SHLIB_SUFFIX := .dylib
|
||||||
HOST_JNILIB_SUFFIX := .jnilib
|
HOST_JNILIB_SUFFIX := .jnilib
|
||||||
|
|
||||||
|
ifeq (,$(TARGET_BUILD_APPS))
|
||||||
HOST_GLOBAL_CFLAGS += \
|
HOST_GLOBAL_CFLAGS += \
|
||||||
-include $(call select-android-config-h,darwin-x86)
|
-include $(call select-android-config-h,darwin-x86)
|
||||||
|
endif
|
||||||
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
||||||
HOST_RUN_RANLIB_AFTER_COPYING := false
|
HOST_RUN_RANLIB_AFTER_COPYING := false
|
||||||
else
|
else
|
||||||
|
|
|
@ -58,8 +58,10 @@ HOST_GLOBAL_LDFLAGS += -static
|
||||||
endif # BUILD_HOST_static
|
endif # BUILD_HOST_static
|
||||||
|
|
||||||
HOST_GLOBAL_CFLAGS += -fPIC
|
HOST_GLOBAL_CFLAGS += -fPIC
|
||||||
|
ifeq (,$(TARGET_BUILD_APPS))
|
||||||
HOST_GLOBAL_CFLAGS += \
|
HOST_GLOBAL_CFLAGS += \
|
||||||
-include $(call select-android-config-h,linux-x86)
|
-include $(call select-android-config-h,linux-x86)
|
||||||
|
endif
|
||||||
|
|
||||||
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
||||||
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
||||||
|
|
|
@ -60,7 +60,7 @@ ifneq ($(wildcard $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)),)
|
||||||
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
|
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
|
||||||
else
|
else
|
||||||
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
|
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
|
||||||
$(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
|
$(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -98,9 +98,6 @@ ifeq ($(FORCE_ARM_DEBUGGING),true)
|
||||||
TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
|
TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
android_config_h := $(call select-android-config-h,linux-arm)
|
|
||||||
arch_include_dir := $(dir $(android_config_h))
|
|
||||||
|
|
||||||
TARGET_GLOBAL_CFLAGS += \
|
TARGET_GLOBAL_CFLAGS += \
|
||||||
-msoft-float -fpic -fPIE \
|
-msoft-float -fpic -fPIE \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
|
@ -111,9 +108,11 @@ TARGET_GLOBAL_CFLAGS += \
|
||||||
-Werror=format-security \
|
-Werror=format-security \
|
||||||
-D_FORTIFY_SOURCE=1 \
|
-D_FORTIFY_SOURCE=1 \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
$(arch_variant_cflags) \
|
$(arch_variant_cflags)
|
||||||
-include $(android_config_h) \
|
|
||||||
-I $(arch_include_dir)
|
android_config_h := $(call select-android-config-h,linux-arm)
|
||||||
|
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
|
||||||
|
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
|
||||||
|
|
||||||
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
|
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
|
||||||
# We cannot turn it off blindly since the option is not available
|
# We cannot turn it off blindly since the option is not available
|
||||||
|
@ -147,9 +146,9 @@ TARGET_GLOBAL_LDFLAGS += \
|
||||||
# since sometimes thumb-interwork appears to be default), we
|
# since sometimes thumb-interwork appears to be default), we
|
||||||
# specifically disable when thumb support is unavailable.
|
# specifically disable when thumb support is unavailable.
|
||||||
ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
|
ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
|
||||||
TARGET_GLOBAL_CFLAGS += -mthumb-interwork
|
TARGET_GLOBAL_CFLAGS += -mthumb-interwork
|
||||||
else
|
else
|
||||||
TARGET_GLOBAL_CFLAGS += -mno-thumb-interwork
|
TARGET_GLOBAL_CFLAGS += -mno-thumb-interwork
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
|
TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
|
||||||
|
@ -274,7 +273,7 @@ endef
|
||||||
define transform-o-to-executable-inner
|
define transform-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
||||||
-Wl,-dynamic-linker,/system/bin/linker \
|
-Wl,-dynamic-linker,/system/bin/linker \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
$(TARGET_GLOBAL_LD_DIRS) \
|
$(TARGET_GLOBAL_LD_DIRS) \
|
||||||
|
@ -297,7 +296,7 @@ endef
|
||||||
|
|
||||||
define transform-o-to-static-executable-inner
|
define transform-o-to-static-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
$(TARGET_GLOBAL_LD_DIRS) \
|
$(TARGET_GLOBAL_LD_DIRS) \
|
||||||
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \
|
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \
|
||||||
|
|
|
@ -60,7 +60,7 @@ ifneq ($(wildcard $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)),)
|
||||||
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
|
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
|
||||||
else
|
else
|
||||||
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
|
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
|
||||||
$(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
|
$(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -78,9 +78,6 @@ ifeq ($(FORCE_MIPS_DEBUGGING),true)
|
||||||
TARGET_mips_CFLAGS += -fno-omit-frame-pointer
|
TARGET_mips_CFLAGS += -fno-omit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
android_config_h := $(call select-android-config-h,linux-mips)
|
|
||||||
arch_include_dir := $(dir $(android_config_h))
|
|
||||||
|
|
||||||
TARGET_GLOBAL_CFLAGS += \
|
TARGET_GLOBAL_CFLAGS += \
|
||||||
$(TARGET_mips_CFLAGS) \
|
$(TARGET_mips_CFLAGS) \
|
||||||
-Ulinux -U__unix -U__unix__ -Umips \
|
-Ulinux -U__unix -U__unix__ -Umips \
|
||||||
|
@ -89,9 +86,11 @@ TARGET_GLOBAL_CFLAGS += \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
-funwind-tables \
|
-funwind-tables \
|
||||||
-Werror=format-security \
|
-Werror=format-security \
|
||||||
$(arch_variant_cflags) \
|
$(arch_variant_cflags)
|
||||||
-include $(android_config_h) \
|
|
||||||
-I $(arch_include_dir)
|
android_config_h := $(call select-android-config-h,linux-mips)
|
||||||
|
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
|
||||||
|
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
|
||||||
|
|
||||||
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
|
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
|
||||||
# We cannot turn it off blindly since the option is not available
|
# We cannot turn it off blindly since the option is not available
|
||||||
|
|
|
@ -93,8 +93,11 @@ TARGET_GLOBAL_CFLAGS += \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
-fstrict-aliasing \
|
-fstrict-aliasing \
|
||||||
-funswitch-loops \
|
-funswitch-loops \
|
||||||
-funwind-tables \
|
-funwind-tables
|
||||||
-include $(call select-android-config-h,target_linux-x86)
|
|
||||||
|
android_config_h := $(call select-android-config-h,target_linux-x86)
|
||||||
|
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
|
||||||
|
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
|
||||||
|
|
||||||
# XXX: Not sure this is still needed. Must check with our toolchains.
|
# XXX: Not sure this is still needed. Must check with our toolchains.
|
||||||
TARGET_GLOBAL_CPPFLAGS += \
|
TARGET_GLOBAL_CPPFLAGS += \
|
||||||
|
|
Loading…
Reference in New Issue