Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 1 | ############################################################# |
| 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 Hsieh | 4ad1737 | 2018-06-12 10:50:10 -0700 | [diff] [blame] | 7 | # 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. |
| 10 | my_use_clang_lld := true |
| 11 | ifneq (,$(LOCAL_USE_CLANG_LLD)) |
| 12 | ifneq (,$(filter 0 false,$(LOCAL_USE_CLANG_LLD))) |
| 13 | my_use_clang_lld := false |
| 14 | endif |
| 15 | else |
| 16 | ifneq (,$(filter 0 false,$(USE_CLANG_LLD))) |
| 17 | my_use_clang_lld := false |
Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 18 | endif |
| 19 | endif |
Chih-Hung Hsieh | 3365ae7 | 2018-04-23 16:20:10 -0700 | [diff] [blame] | 20 | |
Chih-Hung Hsieh | 3365ae7 | 2018-04-23 16:20:10 -0700 | [diff] [blame] | 21 | ifeq ($(LOCAL_IS_HOST_MODULE),true) |
Pirama Arumuga Nainar | b66f9e6 | 2018-06-25 16:02:08 -0700 | [diff] [blame] | 22 | # 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 Hsieh | 3365ae7 | 2018-04-23 16:20:10 -0700 | [diff] [blame] | 24 | ifeq ($(HOST_OS),darwin) |
| 25 | my_use_clang_lld := false |
| 26 | endif |
Pirama Arumuga Nainar | b66f9e6 | 2018-06-25 16:02:08 -0700 | [diff] [blame] | 27 | # 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 Hsieh | 3365ae7 | 2018-04-23 16:20:10 -0700 | [diff] [blame] | 31 | endif |