platform_build/core/use_lld_setup.mk
Pirama Arumuga Nainar 060741e77d Use $(my_prefix)OS instead of HOST_CROSS_OS
The latter is not module-specific and affects all host modules.  Also
remove the check for LOCAL_IS_HOST_MODULE and use  $(my_prefix)OS.

This should be future-proof, where may use different configurations of
cross-compilations across Linux, Darwin, Windows.

Test: m native
Change-Id: I0a6255a8b83960ffb543b593d4a50d963be1de88
2018-06-27 10:37:54 -07:00

29 lines
1,010 B
Makefile

#############################################################
## Set up flags based on USE_CLANG_LLD and LOCAL_USE_CLANG_LLD.
## Input variables: USE_CLANG_LLD,LOCAL_USE_CLANG_LLD.
## Output variables: my_use_clang_lld
#############################################################
# Use LLD by default.
# Do not use LLD if LOCAL_USE_CLANG_LLD is false or 0,
# of if LOCAL_USE_CLANG_LLD is not set and USE_CLANG_LLD is 0 or false.
my_use_clang_lld := true
ifneq (,$(LOCAL_USE_CLANG_LLD))
ifneq (,$(filter 0 false,$(LOCAL_USE_CLANG_LLD)))
my_use_clang_lld := false
endif
else
ifneq (,$(filter 0 false,$(USE_CLANG_LLD)))
my_use_clang_lld := false
endif
endif
# Do not use LLD for Darwin host executables or shared libraries. See
# https://lld.llvm.org/AtomLLD.html for status of lld for Mach-O.
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