From da8febf39cbd910e3c6af1de76d50e4f60d71d66 Mon Sep 17 00:00:00 2001 From: Chih-hung Hsieh Date: Tue, 8 May 2018 20:13:41 +0000 Subject: [PATCH] Revert "Revert "Set global default to use lld."" This reverts commit 44988be862cd7954d6344d004bdc6139a4bd4f77. Three known build failures with lld are fixed by (1) adding --no-fatal-warnings to link (2) disable LLD for some PGO build targets (3) disable LLD for some art oatdump tests, pending c/681542 Change-Id: Icebf6661509bf4f6051f91dc74eaa07dbc7c1d42 --- core/soong_config.mk | 2 +- core/use_lld_setup.mk | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/soong_config.mk b/core/soong_config.mk index 4d502ec52..54ad78336 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -101,7 +101,7 @@ $(call add_json_list, CFIExcludePaths, $(CFI_EXCLUDE_PATHS) $( $(call add_json_list, CFIIncludePaths, $(CFI_INCLUDE_PATHS) $(PRODUCT_CFI_INCLUDE_PATHS)) $(call add_json_list, IntegerOverflowExcludePaths, $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS)) -$(call add_json_bool, UseClangLld, $(filter 1 true,$(USE_CLANG_LLD))) +$(call add_json_bool, UseClangLld, $(call invert_bool,$(filter 0 false,$(USE_CLANG_LLD)))) $(call add_json_bool, ClangTidy, $(filter 1 true,$(WITH_TIDY))) $(call add_json_str, TidyChecks, $(WITH_TIDY_CHECKS)) diff --git a/core/use_lld_setup.mk b/core/use_lld_setup.mk index 17a9e2760..464726c75 100644 --- a/core/use_lld_setup.mk +++ b/core/use_lld_setup.mk @@ -4,12 +4,17 @@ ## Output variables: my_use_clang_lld ############################################################# -# Use LLD only if it's not disabled by LOCAL_USE_CLANG_LLD, -# and enabled by LOCAL_USE_CLANG_LLD or USE_CLANG_LLD. -my_use_clang_lld := false -ifeq (,$(filter 0 false,$(LOCAL_USE_CLANG_LLD))) - ifneq (,$(filter 1 true,$(LOCAL_USE_CLANG_LLD) $(USE_CLANG_LLD))) - my_use_clang_lld := true +# Use LLD by default. +# Do not use LLD if LOCAL_USE_CLANG_LLD is false or 0, +# or 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