diff options
Diffstat (limited to 'core')
33 files changed, 118 insertions, 424 deletions
diff --git a/core/binary.mk b/core/binary.mk index 8ab63e4..b405db3 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -116,7 +116,7 @@ my_generated_sources := $(LOCAL_GENERATED_SOURCES) # MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because # all code is position independent, and then those warnings get promoted to # errors. -ifeq ($(strip $(USE_MINGW)),) +ifndef USE_MINGW ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES) my_cflags += -fpie else @@ -133,12 +133,29 @@ my_asflags += $(LOCAL_ASFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $ my_c_includes += $(LOCAL_C_INCLUDES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_C_INCLUDES_$(my_32_64_bit_suffix)) my_generated_sources += $(LOCAL_GENERATED_SOURCES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_GENERATED_SOURCES_$(my_32_64_bit_suffix)) -my_clang := $(LOCAL_CLANG) +my_clang := $(strip $(LOCAL_CLANG)) ifdef LOCAL_CLANG_$(my_32_64_bit_suffix) -my_clang := $(LOCAL_CLANG_$(my_32_64_bit_suffix)) +my_clang := $(strip $(LOCAL_CLANG_$(my_32_64_bit_suffix))) endif ifdef LOCAL_CLANG_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) -my_clang := $(LOCAL_CLANG_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) +my_clang := $(strip $(LOCAL_CLANG_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))) +endif + +# clang is enabled by default for host builds +# enable it unless we've specifically disabled clang above +ifdef LOCAL_IS_HOST_MODULE + ifneq ($(HOST_OS),windows) + ifeq ($(my_clang),) + my_clang := true + endif + endif +endif + +# Add option to make clang the default for device build +ifeq ($(USE_CLANG_PLATFORM_BUILD),true) + ifeq ($(my_clang),) + my_clang := true + endif endif # arch-specific static libraries go first so that generic ones can depend on them @@ -297,7 +314,7 @@ else endif ifeq ($(strip $(my_cc)),) - ifeq ($(strip $(my_clang)),true) + ifeq ($(my_clang),true) my_cc := $(CLANG) else my_cc := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)CC) @@ -313,7 +330,7 @@ endif $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CC := $(my_cc) ifeq ($(strip $(my_cxx)),) - ifeq ($(strip $(my_clang)),true) + ifeq ($(my_clang),true) my_cxx := $(CLANG_CXX) else my_cxx := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)CXX) @@ -363,7 +380,7 @@ normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb) # actually used (although they are usually empty). arm_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(arm_objects_mode)_CFLAGS) normal_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(normal_objects_mode)_CFLAGS) -ifeq ($(strip $(my_clang)),true) +ifeq ($(my_clang),true) arm_objects_cflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(arm_objects_cflags)) normal_objects_cflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(normal_objects_cflags)) endif diff --git a/core/clang/HOST_x86.mk b/core/clang/HOST_x86.mk index 510a74d..fb5cbf4 100644 --- a/core/clang/HOST_x86.mk +++ b/core/clang/HOST_x86.mk @@ -11,6 +11,10 @@ CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EXTRA endif ifeq ($(HOST_OS),darwin) CLANG_CONFIG_x86_HOST_TRIPLE := i686-apple-darwin +CLANG_CONFIG_x86_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_ASFLAGS) +CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CFLAGS) +CLANG_CONFIG_x86_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CPPFLAGS) +CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_LDFLAGS) endif ifeq ($(HOST_OS),windows) CLANG_CONFIG_x86_HOST_TRIPLE := i686-pc-mingw32 diff --git a/core/clang/HOST_x86_64.mk b/core/clang/HOST_x86_64.mk index 6b94525..5f70678 100644 --- a/core/clang/HOST_x86_64.mk +++ b/core/clang/HOST_x86_64.mk @@ -11,6 +11,10 @@ CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_LINUX_HOST_EX endif ifeq ($(HOST_OS),darwin) CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-apple-darwin +CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_ASFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_ASFLAGS) +CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CFLAGS) +CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_CPPFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CPPFLAGS) +CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS := $(CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_LDFLAGS) endif ifeq ($(HOST_OS),windows) CLANG_CONFIG_x86_64_HOST_TRIPLE := x86_64-pc-mingw64 diff --git a/core/clang/HOST_x86_common.mk b/core/clang/HOST_x86_common.mk index 0241cb6..92058e1 100644 --- a/core/clang/HOST_x86_common.mk +++ b/core/clang/HOST_x86_common.mk @@ -1,7 +1,11 @@ # Shared by HOST_x86.mk and HOST_x86_64.mk. ifeq ($(HOST_OS),darwin) -# nothing required here yet +CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_ASFLAGS := \ + -integrated-as + +CLANG_CONFIG_x86_DARWIN_HOST_EXTRA_CFLAGS := \ + -integrated-as endif ifeq ($(HOST_OS),linux) @@ -18,34 +22,34 @@ ifneq ($(strip $($(clang_2nd_arch_prefix)HOST_IS_64_BIT)),) CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \ --gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8 \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/x86_64-linux \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/backward \ -no-integrated-as CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \ --gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \ - -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \ - -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \ + -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.8 \ + -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.8 \ -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib64/ \ -no-integrated-as else CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \ --gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux/32 \ - -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8 \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/x86_64-linux/32 \ + -isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/backward \ -no-integrated-as CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \ --gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \ --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \ -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \ - -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \ - -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \ + -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.8/32 \ + -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.8/32 \ -L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib32/ \ -no-integrated-as endif diff --git a/core/clang/arm.mk b/core/clang/arm.mk index 22c7397..f979409 100644 --- a/core/clang/arm.mk +++ b/core/clang/arm.mk @@ -19,9 +19,15 @@ CLANG_CONFIG_arm_UNKNOWN_CFLAGS := \ -fgcse-after-reload \ -frerun-cse-after-loop \ -frename-registers \ + -fno-align-jumps \ -fno-builtin-sin \ + -fno-caller-saves \ + -fno-early-inlining \ + -fno-move-loop-invariants \ + -fno-partial-inlining \ -fno-strict-volatile-bitfields \ - -fno-align-jumps \ + -fno-tree-copy-prop \ + -fno-tree-loop-optimize \ -Wa,--noexecstack define subst-clang-incompatible-arm-flags diff --git a/core/clang/config.mk b/core/clang/config.mk index c1625f2..b58d264 100644 --- a/core/clang/config.mk +++ b/core/clang/config.mk @@ -43,16 +43,19 @@ CLANG_CONFIG_EXTRA_CFLAGS += \ -Werror=int-conversion CLANG_CONFIG_UNKNOWN_CFLAGS := \ - -funswitch-loops \ - -fno-tree-sra \ -finline-limit=64 \ + -fno-canonical-system-headers \ + -fno-tree-sra \ + -funswitch-loops \ + -Wmaybe-uninitialized \ + -Wno-error=maybe-uninitialized \ + -Wno-literal-suffix \ + -Wno-maybe-uninitialized \ + -Wno-old-style-declaration \ -Wno-psabi \ -Wno-unused-but-set-variable \ -Wno-unused-but-set-parameter \ - -Wmaybe-uninitialized \ - -Wno-maybe-uninitialized \ - -Wno-error=maybe-uninitialized \ - -fno-canonical-system-headers + -Wno-unused-local-typedefs # Clang flags for all host rules CLANG_CONFIG_HOST_EXTRA_ASFLAGS := diff --git a/core/clang/mips.mk b/core/clang/mips.mk index 1624b6f..08daf40 100644 --- a/core/clang/mips.mk +++ b/core/clang/mips.mk @@ -7,14 +7,6 @@ CLANG_CONFIG_mips_EXTRA_LDFLAGS := # Include common unknown flags CLANG_CONFIG_mips_UNKNOWN_CFLAGS := \ $(CLANG_CONFIG_UNKNOWN_CFLAGS) \ - -mips32 \ - -mips32r2 \ - -mips32r6 \ - -mfp32 \ - -mfp64 \ - -mfpxx \ - -modd-spreg \ - -mno-odd-spreg \ -fno-strict-volatile-bitfields \ -fgcse-after-reload \ -frerun-cse-after-loop \ diff --git a/core/clang/mips64.mk b/core/clang/mips64.mk index a76aa08..612175c 100644 --- a/core/clang/mips64.mk +++ b/core/clang/mips64.mk @@ -7,7 +7,6 @@ CLANG_CONFIG_mips64_EXTRA_LDFLAGS := # Include common unknown flags CLANG_CONFIG_mips64_UNKNOWN_CFLAGS := \ $(CLANG_CONFIG_UNKNOWN_CFLAGS) \ - -mips64r6 \ -fno-strict-volatile-bitfields \ -fgcse-after-reload \ -frerun-cse-after-loop \ diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk index 4a2bfe3..c2b80de 100644 --- a/core/combo/HOST_darwin-x86.mk +++ b/core/combo/HOST_darwin-x86.mk @@ -33,8 +33,6 @@ include $(BUILD_COMBOS)/mac_version.mk $(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1 $(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version) -# Don't do anything if the toolchain is not there -ifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-gcc))) $(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-gcc $(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-g++ ifeq ($(mac_sdk_version),10.8) @@ -42,10 +40,6 @@ ifeq ($(mac_sdk_version),10.8) host_toolchain_header := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)/lib/gcc/i686-apple-darwin$(gcc_darwin_version)/4.2.1/include $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -isystem $(host_toolchain_header) endif -else -$(combo_2nd_arch_prefix)HOST_CC := gcc -$(combo_2nd_arch_prefix)HOST_CXX := g++ -endif # $(HOST_TOOLCHAIN_PREFIX)-gcc exists # gcc location for clang; to be updated when clang is updated # HOST_TOOLCHAIN_ROOT is a Darwin-specific define diff --git a/core/combo/HOST_darwin-x86_64.mk b/core/combo/HOST_darwin-x86_64.mk index 0bc0227..1ea3310 100644 --- a/core/combo/HOST_darwin-x86_64.mk +++ b/core/combo/HOST_darwin-x86_64.mk @@ -33,8 +33,6 @@ include $(BUILD_COMBOS)/mac_version.mk HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1 HOST_TOOLCHAIN_PREFIX := $(HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version) -# Don't do anything if the toolchain is not there -ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)-gcc))) HOST_CC := $(HOST_TOOLCHAIN_PREFIX)-gcc HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)-g++ ifeq ($(mac_sdk_version),10.8) @@ -42,10 +40,6 @@ ifeq ($(mac_sdk_version),10.8) host_toolchain_header := $(HOST_TOOLCHAIN_ROOT)/lib/gcc/i686-apple-darwin$(gcc_darwin_version)/4.2.1/include HOST_GLOBAL_CFLAGS += -isystem $(host_toolchain_header) endif -else -HOST_CC := gcc -HOST_CXX := g++ -endif # $(HOST_TOOLCHAIN_PREFIX)-gcc exists # gcc location for clang; to be updated when clang is updated # HOST_TOOLCHAIN_ROOT is a Darwin-specific define diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk index 3ca7443..78a9f8e 100644 --- a/core/combo/HOST_linux-x86.mk +++ b/core/combo/HOST_linux-x86.mk @@ -18,17 +18,14 @@ # Included by combo/select.mk ifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),) -$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux- +$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/bin/x86_64-linux- endif -# Don't do anything if the toolchain is not there -ifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc))) $(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc $(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)g++ $(combo_2nd_arch_prefix)HOST_AR := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)ar -endif # $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc exists # gcc location for clang; to be updated when clang is updated -$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/ +$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/ # We expect SSE3 floating point math. $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott diff --git a/core/combo/HOST_linux-x86_64.mk b/core/combo/HOST_linux-x86_64.mk index 53a3ae8..86877b3 100644 --- a/core/combo/HOST_linux-x86_64.mk +++ b/core/combo/HOST_linux-x86_64.mk @@ -18,17 +18,14 @@ # Included by combo/select.mk ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),) -HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux- +HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/bin/x86_64-linux- endif -# Don't do anything if the toolchain is not there -ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)gcc))) HOST_CC := $(HOST_TOOLCHAIN_PREFIX)gcc HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++ HOST_AR := $(HOST_TOOLCHAIN_PREFIX)ar -endif # $(HOST_TOOLCHAIN_PREFIX)gcc exists # gcc location for clang; to be updated when clang is updated -HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/ +HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/ HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack diff --git a/core/combo/HOST_windows-x86.mk b/core/combo/HOST_windows-x86.mk index 4d871d8..766c14a 100644 --- a/core/combo/HOST_windows-x86.mk +++ b/core/combo/HOST_windows-x86.mk @@ -24,7 +24,7 @@ TOOLS_EXE_SUFFIX := .exe # Settings to use MinGW has a cross-compiler under Linux ifneq ($(findstring Linux,$(UNAME)),) -ifneq ($(strip $(USE_MINGW)),) +ifdef USE_MINGW HOST_ACP_UNAVAILABLE := true TOOLS_EXE_SUFFIX := $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW diff --git a/core/combo/HOST_windows-x86_64.mk b/core/combo/HOST_windows-x86_64.mk index c77d82c..bd392ea 100644 --- a/core/combo/HOST_windows-x86_64.mk +++ b/core/combo/HOST_windows-x86_64.mk @@ -24,7 +24,7 @@ TOOLS_EXE_SUFFIX := .exe # Settings to use MinGW has a cross-compiler under Linux ifneq ($(findstring Linux,$(UNAME)),) -ifneq ($(strip $(USE_MINGW)),) +ifdef USE_MINGW HOST_ACP_UNAVAILABLE := true TOOLS_EXE_SUFFIX := HOST_GLOBAL_CFLAGS += -DUSE_MINGW diff --git a/core/combo/arch/x86/haswell.mk b/core/combo/arch/x86/haswell.mk index a00e0a6..0b16b80 100644 --- a/core/combo/arch/x86/haswell.mk +++ b/core/combo/arch/x86/haswell.mk @@ -7,6 +7,8 @@ ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := true # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86/ivybridge.mk b/core/combo/arch/x86/ivybridge.mk index 02dc1e0..a8e66f3 100644 --- a/core/combo/arch/x86/ivybridge.mk +++ b/core/combo/arch/x86/ivybridge.mk @@ -7,6 +7,8 @@ ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := false # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86/sandybridge.mk b/core/combo/arch/x86/sandybridge.mk index dfa540c..8e474a5 100644 --- a/core/combo/arch/x86/sandybridge.mk +++ b/core/combo/arch/x86/sandybridge.mk @@ -2,9 +2,13 @@ # Generating binaries for SandyBridge processors. # ARCH_X86_HAVE_SSSE3 := true +ARCH_X86_HAVE_SSE4 := true ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true +ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := false # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86_64/haswell.mk b/core/combo/arch/x86_64/haswell.mk index 9cf95b3..6067eee 100644 --- a/core/combo/arch/x86_64/haswell.mk +++ b/core/combo/arch/x86_64/haswell.mk @@ -7,6 +7,8 @@ ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := true # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86_64/ivybridge.mk b/core/combo/arch/x86_64/ivybridge.mk index 7b95190..90e23a9 100644 --- a/core/combo/arch/x86_64/ivybridge.mk +++ b/core/combo/arch/x86_64/ivybridge.mk @@ -7,6 +7,8 @@ ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := false # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86_64/sandybridge.mk b/core/combo/arch/x86_64/sandybridge.mk index a443b6b..865548c 100644 --- a/core/combo/arch/x86_64/sandybridge.mk +++ b/core/combo/arch/x86_64/sandybridge.mk @@ -2,9 +2,13 @@ # Generating binaries for SandyBridge processors. # ARCH_X86_HAVE_SSSE3 := true +ARCH_X86_HAVE_SSE4 := true ARCH_X86_HAVE_SSE4_1 := true ARCH_X86_HAVE_SSE4_2 := true +ARCH_X86_HAVE_AES_NI := true ARCH_X86_HAVE_AVX := true +ARCH_X86_HAVE_POPCNT := true +ARCH_X86_HAVE_MOVBE := false # CFLAGS for this arch arch_variant_cflags := \ diff --git a/core/combo/arch/x86_64/x86_64-atom.mk b/core/combo/arch/x86_64/x86_64-atom.mk deleted file mode 100755 index 64b07a0..0000000 --- a/core/combo/arch/x86_64/x86_64-atom.mk +++ /dev/null @@ -1,13 +0,0 @@ -# This file contains feature macro definitions specific to the -# 'x86_64-atom' arch variant. This is an extension of the 'x86_64' base variant -# that adds Atom-specific features. -# -# See build/core/combo/arch/x86_64/x86_64.mk for differences. -# -ARCH_X86_HAVE_SSSE3 := true -ARCH_X86_HAVE_MOVBE := true -ARCH_X86_HAVE_POPCNT := false # popcnt is not supported by current Atom CPUs - -# CFLAGS for this arch -arch_variant_cflags := \ - -march=atom diff --git a/core/combo/include/arch/darwin-x86/AndroidConfig.h b/core/combo/include/arch/darwin-x86/AndroidConfig.h index 54f3750..f6c3e53 100644 --- a/core/combo/include/arch/darwin-x86/AndroidConfig.h +++ b/core/combo/include/arch/darwin-x86/AndroidConfig.h @@ -42,12 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have the futex syscall? - */ - -/* #define HAVE_FUTEX */ - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -79,11 +73,6 @@ #define HAVE_TERMIO_H /* - * Define this if you have <sys/sendfile.h> - */ -/* #define HAVE_SYS_SENDFILE_H 1 */ - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -110,11 +99,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -/* #define HAVE_IOCTL */ - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -158,18 +142,6 @@ #define HAVE_BACKTRACE 0 /* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - - -/* * Add any extra platform-specific defines here. */ #define _THREAD_SAFE @@ -214,11 +186,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.dylib" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -241,11 +208,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/linux-arm/AndroidConfig.h b/core/combo/include/arch/linux-arm/AndroidConfig.h index c06c8bc..e5e2898 100644 --- a/core/combo/include/arch/linux-arm/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm/AndroidConfig.h @@ -42,19 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -86,11 +73,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -117,11 +99,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -166,17 +143,6 @@ */ #define HAVE_BACKTRACE 0 -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - /* * Defined if we have the sched_setscheduler() call */ @@ -251,11 +217,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -276,11 +237,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/linux-arm64/AndroidConfig.h b/core/combo/include/arch/linux-arm64/AndroidConfig.h index bcbda8f..93e034f 100644 --- a/core/combo/include/arch/linux-arm64/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm64/AndroidConfig.h @@ -42,19 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -93,11 +80,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -124,11 +106,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -169,17 +146,6 @@ #define HAVE_BACKTRACE 0 /* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* * Defined if we have the sched_setscheduler() call */ #define HAVE_SCHED_SETSCHEDULER @@ -253,11 +219,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -278,11 +239,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/linux-mips/AndroidConfig.h b/core/combo/include/arch/linux-mips/AndroidConfig.h index bb3dc95..f87cb85 100644 --- a/core/combo/include/arch/linux-mips/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips/AndroidConfig.h @@ -42,19 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -86,11 +73,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -117,11 +99,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -172,17 +149,6 @@ #define HAVE_BACKTRACE 0 /* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* * Defined if we have the sched_setscheduler() call */ #define HAVE_SCHED_SETSCHEDULER @@ -268,11 +234,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -293,11 +254,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/linux-mips64/AndroidConfig.h b/core/combo/include/arch/linux-mips64/AndroidConfig.h index 7ded3ce..eb2421a 100644 --- a/core/combo/include/arch/linux-mips64/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips64/AndroidConfig.h @@ -42,19 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -93,11 +80,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -124,11 +106,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -169,17 +146,6 @@ #define HAVE_BACKTRACE 0 /* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - -/* * Defined if we have the sched_setscheduler() call */ #define HAVE_SCHED_SETSCHEDULER @@ -265,11 +231,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -290,11 +251,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h index 5523e49..c6be3d9 100644 --- a/core/combo/include/arch/linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/linux-x86/AndroidConfig.h @@ -42,12 +42,6 @@ #define HAVE_PTHREADS /* - * Do we have the futex syscall? - */ - -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -79,11 +73,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against MSVCRT.DLL */ /* #define HAVE_MS_C_RUNTIME */ @@ -110,11 +99,6 @@ #define HAVE_GETHOSTBYNAME_R /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -159,17 +143,6 @@ */ #define HAVE_BACKTRACE 1 -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -/* #define HAVE_GETTID */ - /* * Defined if we have the sched_setscheduler() call */ @@ -231,11 +204,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -256,11 +224,6 @@ /* #define HAVE_STRLCPY 1 */ /* - * Define if the open_memstream() function exists on the system. - */ -#define HAVE_OPEN_MEMSTREAM 1 - -/* * Define if the BSD funopen() function exists on the system. */ /* #define HAVE_FUNOPEN 1 */ diff --git a/core/combo/include/arch/target_linux-x86/AndroidConfig.h b/core/combo/include/arch/target_linux-x86/AndroidConfig.h index c267b2b..ec82710 100644 --- a/core/combo/include/arch/target_linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/target_linux-x86/AndroidConfig.h @@ -28,19 +28,6 @@ #define HAVE_PTHREADS /* - * Do we have pthread_setname_np()? - * - * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with - * the same name but different parameters, so we can't use that here.) - */ -#define HAVE_ANDROID_PTHREAD_SETNAME_NP - -/* - * Do we have the futex syscall? - */ -#define HAVE_FUTEX - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -72,11 +59,6 @@ #define HAVE_TERMIO_H 1 /* - * Define this if you have <sys/sendfile.h> - */ -#define HAVE_SYS_SENDFILE_H 1 - -/* * Define this if you build against have Microsoft C runtime (MSVCRT.DLL) */ /* #define HAVE_MS_C_RUNTIME */ @@ -103,11 +85,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -#define HAVE_IOCTL - -/* * Define this if we want to use WinSock. */ /* #define HAVE_WINSOCK */ @@ -155,17 +132,6 @@ */ #define HAVE_BACKTRACE 0 -/* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* - * Defined if we have the gettid() system call. - */ -#define HAVE_GETTID - /* * Defined if we have the sched_setscheduler() call */ @@ -240,11 +206,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.so" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '/' @@ -265,11 +226,6 @@ #define HAVE_STRLCPY 1 /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ #define HAVE_FUNOPEN 1 diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h index 204740d..316d642 100644 --- a/core/combo/include/arch/windows/AndroidConfig.h +++ b/core/combo/include/arch/windows/AndroidConfig.h @@ -64,13 +64,6 @@ #define HAVE_WIN32_THREADS /* - * Do we have the futex syscall? - */ - -/* #define HAVE_FUTEX */ - - -/* * Process creation model. Choose one: * * HAVE_FORKEXEC - use fork() and exec() @@ -112,13 +105,6 @@ #endif /* - * Define this if you have <sys/sendfile.h> - */ -#ifdef __CYGWIN__ -# define HAVE_SYS_SENDFILE_H 1 -#endif - -/* * Define this if you build against MSVCRT.DLL */ #ifndef __CYGWIN__ @@ -144,11 +130,6 @@ /* #define HAVE_GETHOSTBYNAME_R */ /* - * Define this if we have ioctl(). - */ -/* #define HAVE_IOCTL */ - -/* * Define this if we want to use WinSock. */ #ifndef __CYGWIN__ @@ -200,12 +181,6 @@ #define HAVE_BACKTRACE 0 /* - * Defined if we have the cxxabi.h header for demangling C++ symbols. If - * not defined, stack crawls will be displayed with raw mangled symbols - */ -#define HAVE_CXXABI 0 - -/* * Define if tm struct has tm_gmtoff field */ /* #define HAVE_TM_GMTOFF 1 */ @@ -251,11 +226,6 @@ #define OS_SHARED_LIB_FORMAT_STR "lib%s.dll" /* - * type for the third argument to mincore(). - */ -#define MINCORE_POINTER_TYPE unsigned char * - -/* * The default path separator for the platform */ #define OS_PATH_SEPARATOR '\\' @@ -281,11 +251,6 @@ /* #define HAVE_STRLCPY 1 */ /* - * Define if the open_memstream() function exists on the system. - */ -/* #define HAVE_OPEN_MEMSTREAM 1 */ - -/* * Define if the BSD funopen() function exists on the system. */ /* #define HAVE_FUNOPEN 1 */ diff --git a/core/definitions.mk b/core/definitions.mk index 3bded9f..0479b26 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1176,7 +1176,7 @@ endef # $(1): the full path of the source static library. define _extract-and-include-single-target-whole-static-lib -@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(1)]" +@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(strip $(1))]" $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;\ rm -rf $$ldir; \ mkdir -p $$ldir; \ @@ -1190,8 +1190,16 @@ $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs; endef +# $(1): the full path of the source static library. +define extract-and-include-whole-static-libs-first +$(if $(strip $(1)), +@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(strip $(1))]" +$(hide) cp $(1) $@) +endef + define extract-and-include-target-whole-static-libs -$(foreach lib,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES), \ +$(call extract-and-include-whole-static-libs-first, $(firstword $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES))) +$(foreach lib,$(wordlist 2,999,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)), \ $(call _extract-and-include-single-target-whole-static-lib, $(lib))) endef @@ -1213,7 +1221,7 @@ endef # $(1): the full path of the source static library. define _extract-and-include-single-host-whole-static-lib -@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(1)]" +@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(strip $(1))]" $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;\ rm -rf $$ldir; \ mkdir -p $$ldir; \ @@ -1228,7 +1236,8 @@ $(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs; endef define extract-and-include-host-whole-static-libs -$(foreach lib,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES), \ +$(call extract-and-include-whole-static-libs-first, $(firstword $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES))) +$(foreach lib,$(wordlist 2,999,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)), \ $(call _extract-and-include-single-host-whole-static-lib, $(lib))) endef diff --git a/core/envsetup.mk b/core/envsetup.mk index 124a91b..cfc9650 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -58,7 +58,7 @@ BUILD_OS := $(HOST_OS) # Under Linux, if USE_MINGW is set, we change HOST_OS to Windows to build the # Windows SDK. Only a subset of tools and SDK will manage to build properly. ifeq ($(HOST_OS),linux) -ifneq ($(USE_MINGW),) +ifdef USE_MINGW HOST_OS := windows endif endif @@ -67,13 +67,6 @@ ifeq ($(HOST_OS),) $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!) endif -# TODO: Replace BUILD_HOST_64bit with a flag that forces 32-bit build, -# after we default to 64-bit host build. -ifeq (,$(BUILD_HOST_64bit)) -# Default to 32-bit-by-default multilib host build. -HOST_PREFER_32_BIT := true -endif - # HOST_ARCH ifneq (,$(findstring x86_64,$(UNAME))) HOST_ARCH := x86_64 @@ -81,12 +74,6 @@ ifneq (,$(findstring x86_64,$(UNAME))) HOST_IS_64_BIT := true endif -ifeq ($(HOST_PREFER_32_BIT),true) -SDK_HOST_ARCH := x86 -else -SDK_HOST_ARCH := $(HOST_ARCH) -endif - BUILD_ARCH := $(HOST_ARCH) BUILD_2ND_ARCH := $(HOST_2ND_ARCH) @@ -143,6 +130,17 @@ $(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT)) $(error must be empty or one of: eng user userdebug) endif +# Build host as 32-bit for SDK build. +ifneq ($(filter $(MAKECMDGOALS),win_sdk sdk),) +HOST_PREFER_32_BIT := true +endif +ifdef USE_MINGW +# We only build sdk host tools in the MinGW windows build. +# Build it as 32-bit as well. +HOST_PREFER_32_BIT := true +endif +SDK_HOST_ARCH := x86 + # Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE) # or under vendor/*/$(TARGET_DEVICE). Search in both places, but # make sure only one exists. diff --git a/core/main.mk b/core/main.mk index fcddf89..6542135 100644 --- a/core/main.mk +++ b/core/main.mk @@ -769,10 +769,6 @@ ifdef is_sdk_build $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \ $(if $(strip $(ALL_MODULES.$(m).INSTALLED) $(ALL_MODULES.$(m)$(TARGET_2ND_ARCH_MODULE_SUFFIX).INSTALLED)),,\ $(eval dangling_modules += $(m)))) - ifneq ($(TARGET_IS_64_BIT),true) - # We know those 64-bit modules don't exist in the 32-bit SDK build. - dangling_modules := $(filter-out %64,$(dangling_modules)) - endif ifneq ($(dangling_modules),) $(warning: Modules '$(dangling_modules)' in PRODUCT_PACKAGES have nothing to install!) endif diff --git a/core/package_internal.mk b/core/package_internal.mk index 0d6f9ea..fd92d01 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -72,8 +72,11 @@ ifdef LOCAL_PACKAGE_SPLITS LOCAL_AAPT_FLAGS += $(addprefix --split ,$(LOCAL_PACKAGE_SPLITS)) endif +need_compile_asset := ifeq (,$(LOCAL_ASSET_DIR)) LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets +else +need_compile_asset := true endif # LOCAL_RESOURCE_DIR may point to resource generated during the build @@ -101,6 +104,10 @@ all_assets := $(strip \ ) \ )) +ifneq ($(all_assets),) +need_compile_asset := true +endif + all_resources := $(strip \ $(foreach dir, $(LOCAL_RESOURCE_DIR), \ $(addprefix $(dir)/, \ @@ -119,7 +126,7 @@ all_res_assets := $(strip $(all_assets) $(all_resources)) package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON) # If no assets or resources were found, clear the directory variables so # we don't try to build them. -ifeq (,$(all_assets)) +ifneq (true,$(need_compile_asset)) LOCAL_ASSET_DIR:= endif ifneq (true,$(need_compile_res)) |