Remove support for building Windows modules in Make

These now must be defined in Android.bp files.

Bug: 122618577
Test: compare build-aosp_arm.ninja before/after
Test: codesearch for LOCAL_MODULE_HOST_OS.*windows
Change-Id: I14451c7753299692940e026f85687b4c3331bb07
This commit is contained in:
Dan Willemsen 2019-01-25 16:54:37 -08:00
parent c6dee37255
commit f264690860
15 changed files with 18 additions and 269 deletions

View File

@ -1,5 +1,10 @@
# Build System Changes for Android.mk Writers
## Windows cross-compiles no longer supported in Android.mk
Modules that build for Windows (our only `HOST_CROSS` OS currently) must now be
defined in `Android.bp` files.
## `LOCAL_MODULE_TAGS := eng debug` deprecation {#LOCAL_MODULE_TAGS}
`LOCAL_MODULE_TAGS` value `eng` and `debug` are being deprecated. They allowed

View File

@ -290,11 +290,9 @@ my_ldlibs := $(filter $(my_allowed_ldlibs),$(my_ldlibs))
else # LOCAL_IS_HOST_MODULE
# Add -ldl, -lpthread, -lm and -lrt to host builds to match the default behavior of
# device builds
ifneq ($($(my_prefix)OS),windows)
my_ldlibs += -ldl -lpthread -lm
ifneq ($(HOST_OS),darwin)
my_ldlibs += -lrt
endif
my_ldlibs += -ldl -lpthread -lm
ifneq ($(HOST_OS),darwin)
my_ldlibs += -lrt
endif
endif
@ -315,17 +313,15 @@ endif
# all code is position independent, and then those warnings get promoted to
# errors.
ifneq ($(LOCAL_NO_PIC),true)
ifneq ($($(my_prefix)OS),windows)
ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
my_cflags += -fPIE
ifndef BUILD_HOST_static
ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
my_ldflags += -pie
endif
ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
my_cflags += -fPIE
ifndef BUILD_HOST_static
ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
my_ldflags += -pie
endif
else
my_cflags += -fPIC
endif
else
my_cflags += -fPIC
endif
endif
@ -430,11 +426,6 @@ endif
include $(BUILD_SYSTEM)/config_sanitizers.mk
# Statically link libwinpthread when cross compiling win32.
ifeq ($($(my_prefix)OS),windows)
my_static_libraries += libwinpthread
endif
ifneq ($(filter ../%,$(my_src_files)),)
my_soong_problems += dotdot_srcs
endif

View File

@ -1,2 +0,0 @@
$(clang_2nd_arch_prefix)HOST_CROSS_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i386.a
$(clang_2nd_arch_prefix)HOST_CROSS_LIBCRT_BUILTINS := $(LLVM_RTLIB_PATH)/libclang_rt.bulitins-i386.a

View File

@ -1,2 +0,0 @@
$(clang_2nd_arch_prefix)HOST_CROSS_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-x86_64.a
$(clang_2nd_arch_prefix)HOST_CROSS_LIBCRT_BUILTINS := $(LLVM_RTLIB_PATH)/libclang_rt.builtins-x86_64.a

View File

@ -44,15 +44,6 @@ clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk
endif
ifdef HOST_CROSS_ARCH
clang_2nd_arch_prefix :=
include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_ARCH).mk
ifdef HOST_CROSS_2ND_ARCH
clang_2nd_arch_prefix := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_2ND_ARCH).mk
endif
endif
# TARGET config
clang_2nd_arch_prefix :=
include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk

View File

@ -160,7 +160,6 @@ LOCAL_MODULE_CLASS:=
LOCAL_MODULE_HOST_ARCH:=
LOCAL_MODULE_HOST_ARCH_WARN:=
LOCAL_MODULE_HOST_CROSS_ARCH:=
LOCAL_MODULE_HOST_CROSS_ARCH_WARN:=
LOCAL_MODULE_HOST_OS:=
LOCAL_MODULE_OWNER:=
LOCAL_MODULE_PATH:=
@ -173,8 +172,6 @@ LOCAL_MODULE_TARGET_ARCH:=
LOCAL_MODULE_TARGET_ARCH_WARN:=
LOCAL_MODULE_UNSUPPORTED_HOST_ARCH:=
LOCAL_MODULE_UNSUPPORTED_HOST_ARCH_WARN:=
LOCAL_MODULE_UNSUPPORTED_HOST_CROSS_ARCH:=
LOCAL_MODULE_UNSUPPORTED_HOST_CROSS_ARCH_WARN:=
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH:=
LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN:=
LOCAL_MULTILIB:=
@ -408,31 +405,10 @@ LOCAL_SHARED_LIBRARIES_$(HOST_OS):=
LOCAL_SRC_FILES_$(HOST_OS):=
LOCAL_STATIC_LIBRARIES_$(HOST_OS):=
ifdef HOST_CROSS_OS
LOCAL_ASFLAGS_$(HOST_CROSS_OS):=
LOCAL_CFLAGS_$(HOST_CROSS_OS):=
LOCAL_C_INCLUDES_$(HOST_CROSS_OS):=
LOCAL_CPPFLAGS_$(HOST_CROSS_OS):=
LOCAL_GENERATED_SOURCES_$(HOST_CROSS_OS):=
LOCAL_HEADER_LIBRARIES_$(HOST_CROSS_OS):=
LOCAL_LDFLAGS_$(HOST_CROSS_OS):=
LOCAL_LDLIBS_$(HOST_CROSS_OS):=
LOCAL_REQUIRED_MODULES_$(HOST_CROSS_OS):=
LOCAL_SHARED_LIBRARIES_$(HOST_CROSS_OS):=
LOCAL_SRC_FILES_$(HOST_CROSS_OS):=
LOCAL_STATIC_LIBRARIES_$(HOST_CROSS_OS):=
endif
LOCAL_SRC_FILES_$(HOST_OS)_$(HOST_ARCH):=
ifdef HOST_2ND_ARCH
LOCAL_SRC_FILES_$(HOST_OS)_$(HOST_2ND_ARCH):=
endif
ifdef HOST_CROSS_OS
LOCAL_SRC_FILES_$(HOST_CROSS_OS)_$(HOST_CROSS_ARCH):=
ifdef HOST_CROSS_2ND_ARCH
LOCAL_SRC_FILES_$(HOST_CROSS_OS)_$(HOST_CROSS_2ND_ARCH):=
endif
endif
LOCAL_ASFLAGS_32:=
LOCAL_ASFLAGS_64:=

View File

@ -13,10 +13,6 @@ ifeq ($(strip $(LOCAL_CXX_STL)),default)
ifneq (,$(BUILD_HOST_static))
my_cxx_stl := libc++_static
endif
ifeq ($($(my_prefix)OS),windows)
my_cxx_stl := libc++_static
endif
endif
else
my_cxx_stl := ndk
@ -35,14 +31,6 @@ else
# the two options use different names for the STLs.
$(error $(LOCAL_PATH): $(LOCAL_MODULE): Must use LOCAL_NDK_STL_VARIANT rather than LOCAL_CXX_STL for NDK binaries)
endif
ifdef LOCAL_IS_HOST_MODULE
ifeq ($($(my_prefix)OS),windows)
ifneq ($(filter $(my_cxx_stl),libc++),)
# only libc++_static is supported on mingw.
my_cxx_stl := libc++_static
endif
endif
endif
endif
# Yes, this is actually what the clang driver does.
@ -50,11 +38,6 @@ linux_dynamic_gcclibs := -lgcc_s -lgcc -lc -lgcc_s -lgcc
linux_static_gcclibs := -Wl,--start-group -lgcc -lgcc_eh -lc -Wl,--end-group
darwin_dynamic_gcclibs := -lc -lSystem
darwin_static_gcclibs := NO_STATIC_HOST_BINARIES_ON_DARWIN
windows_dynamic_gcclibs := \
-Wl,--start-group -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex \
-lmsvcrt -lucrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lpsapi \
-Wl,--end-group
windows_static_gcclibs := NO_STATIC_HOST_BINARIES_ON_WINDOWS
my_link_type := dynamic
ifdef LOCAL_IS_HOST_MODULE
@ -100,20 +83,6 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
my_cppflags += -nostdinc++
my_ldflags += -nodefaultlibs
my_cxx_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs)
ifeq ($($(my_prefix)OS),windows)
# Use SjLj exceptions for 32-bit. libgcc_eh implements SjLj
# exception model for 32-bit.
ifeq (x86,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
my_cppflags += -fsjlj-exceptions
endif
# Disable visibility annotations since we're using libc++ static
# library.
my_cppflags += -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
my_cppflags += -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
# Use Win32 threads in libc++.
my_cppflags += -D_LIBCPP_HAS_THREAD_API_WIN32
endif
else
ifeq (arm,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
my_static_libraries += libunwind_llvm

View File

@ -33,37 +33,4 @@ ifdef $(my_prefix)2ND_ARCH
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif # 2ND_ARCH
ifdef LOCAL_IS_HOST_MODULE
ifdef HOST_CROSS_OS
my_prefix := HOST_CROSS_
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for 2ND_ARCH
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/header_library_internal.mk
endif
ifdef HOST_CROSS_2ND_ARCH
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for HOST_CROSS_2ND_ARCH
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/header_library_internal.mk
endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif
LOCAL_HOST_PREFIX :=
endif
endif
my_module_arch_supported :=

View File

@ -45,47 +45,5 @@ endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif # HOST_2ND_ARCH
ifdef HOST_CROSS_OS
my_prefix := HOST_CROSS_
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for Windows
# we don't want others using the cross compiled version
saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS)
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_executable_internal.mk
LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS)
LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE)
LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
endif
ifdef HOST_CROSS_2ND_ARCH
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# we don't want others using the cross compiled version
saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS)
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_executable_internal.mk
LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS)
LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE)
LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif
LOCAL_HOST_PREFIX :=
endif
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
my_module_arch_supported :=

View File

@ -32,43 +32,6 @@ endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif # HOST_2ND_ARCH
ifdef HOST_CROSS_OS
my_prefix := HOST_CROSS_
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for Windows
LOCAL_BUILT_MODULE :=
LOCAL_MODULE_SUFFIX :=
# We don't want makefiles using the cross-compiled host tool
saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_shared_library_internal.mk
LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
endif
ifdef HOST_CROSS_2ND_ARCH
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for HOST_CROSS_2ND_ARCH
LOCAL_BUILT_MODULE :=
LOCAL_MODULE_SUFFIX :=
# We don't want makefiles using the cross-compiled host tool
saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_shared_library_internal.mk
LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE)
endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif
LOCAL_HOST_PREFIX :=
endif
my_module_arch_supported :=
###########################################################

View File

@ -32,35 +32,6 @@ endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif # HOST_2ND_ARCH
ifdef HOST_CROSS_OS
my_prefix := HOST_CROSS_
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for Windows
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_static_library_internal.mk
endif
ifdef HOST_CROSS_2ND_ARCH
LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# Build for HOST_CROSS_2ND_ARCH
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/host_static_library_internal.mk
endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif
LOCAL_HOST_PREFIX :=
endif
my_module_arch_supported :=
###########################################################

View File

@ -3,7 +3,6 @@
#####################################################
ifeq ($(LOCAL_GTEST),true)
LOCAL_CFLAGS_windows += -DGTEST_OS_WINDOWS
LOCAL_CFLAGS_linux += -DGTEST_OS_LINUX
LOCAL_CFLAGS_darwin += -DGTEST_OS_MAC

View File

@ -62,11 +62,11 @@ endif
ifdef LOCAL_IS_HOST_MODULE
ifneq (,$(LOCAL_MODULE_HOST_OS))
ifneq (,$(filter windows,$(LOCAL_MODULE_HOST_OS)))
$(call pretty-error,Windows is only supported in Android.bp files)
endif
ifeq (,$(filter $($(my_prefix)OS),$(LOCAL_MODULE_HOST_OS)))
my_module_arch_supported := false
endif
else ifeq ($($(my_prefix)OS),windows)
# If LOCAL_MODULE_HOST_OS is empty, only linux and darwin are supported
my_module_arch_supported := false
endif
endif

View File

@ -57,37 +57,4 @@ endif # $(my_skip_non_preferred_arch) not true
LOCAL_2ND_ARCH_VAR_PREFIX :=
ifdef LOCAL_IS_HOST_MODULE
ifdef HOST_CROSS_OS
ifneq (,$(filter EXECUTABLES STATIC_LIBRARIES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)))
my_prefix := HOST_CROSS_
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
# host cross compilation is supported
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/prebuilt_internal.mk
endif
LOCAL_HOST_PREFIX :=
endif
ifdef HOST_CROSS_2ND_ARCH
my_prefix := HOST_CROSS_
LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
LOCAL_HOST_PREFIX := $(my_prefix)
include $(BUILD_SYSTEM)/module_arch_supported.mk
ifeq ($(my_module_arch_supported),true)
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(BUILD_SYSTEM)/prebuilt_internal.mk
endif
LOCAL_HOST_PREFIX :=
LOCAL_2ND_ARCH_VAR_PREFIX :=
endif
endif
endif
my_module_arch_supported :=

View File

@ -18,7 +18,3 @@ endif
ifeq ($($(my_prefix)OS),darwin)
my_use_clang_lld := false
endif
# http://b/110800681 - lld cannot link Android's Windows modules yet.
ifeq ($($(my_prefix)OS),windows)
my_use_clang_lld := false
endif