blob: b0386d53b1e31df3db5123bed8cfaff6ac0f2076 [file] [log] [blame]
Chih-Hung Hsieh32427d62018-04-12 10:55:54 -07001#############################################################
2## Set up flags based on USE_CLANG_LLD and LOCAL_USE_CLANG_LLD.
3## Input variables: USE_CLANG_LLD,LOCAL_USE_CLANG_LLD.
4## Output variables: my_use_clang_lld
5#############################################################
6
Chih-Hung Hsieh4ad17372018-06-12 10:50:10 -07007# Use LLD by default.
8# Do not use LLD if LOCAL_USE_CLANG_LLD is false or 0,
9# of if LOCAL_USE_CLANG_LLD is not set and USE_CLANG_LLD is 0 or false.
10my_use_clang_lld := true
11ifneq (,$(LOCAL_USE_CLANG_LLD))
12 ifneq (,$(filter 0 false,$(LOCAL_USE_CLANG_LLD)))
13 my_use_clang_lld := false
14 endif
15else
16 ifneq (,$(filter 0 false,$(USE_CLANG_LLD)))
17 my_use_clang_lld := false
Chih-Hung Hsieh32427d62018-04-12 10:55:54 -070018 endif
19endif
Chih-Hung Hsieh3365ae72018-04-23 16:20:10 -070020
Chih-Hung Hsieh3365ae72018-04-23 16:20:10 -070021ifeq ($(LOCAL_IS_HOST_MODULE),true)
Pirama Arumuga Nainarb66f9e62018-06-25 16:02:08 -070022 # Do not use LLD for Darwin host executables or shared libraries. See
23 # https://lld.llvm.org/AtomLLD.html for status of lld for Mach-O.
Chih-Hung Hsieh3365ae72018-04-23 16:20:10 -070024 ifeq ($(HOST_OS),darwin)
25 my_use_clang_lld := false
26 endif
Pirama Arumuga Nainarb66f9e62018-06-25 16:02:08 -070027 # http://b/110800681 - lld cannot link Android's Windows modules yet.
28 ifeq ($(HOST_CROSS_OS),windows)
29 my_use_clang_lld := false
30 endif
Chih-Hung Hsieh3365ae72018-04-23 16:20:10 -070031endif