Add USE_CLANG_LLD and LOCAL_USE_CLANG_LLD
* Current default is not using lld.
* When USE_CLANG_LLD or LOCAL_USE_CLANG_LLD is true or 1,
* Use *GLOBAL_LLDFLAGS instead of *GLOBAL_LDFLAGS.
GLOBAL_LLDFLAGS should call lld and with correct lld flags.
* set my_pack_module_relocations to false.
Bug: 73768157
Test: make checkbuild
Change-Id: I3e63cf8ae0865d01d2bc1f36e9304f4a5d092cb8
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 96e2613..a9eb29e 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -6,6 +6,8 @@
##
###########################################################
+include $(BUILD_SYSTEM)/use_lld_setup.mk
+
ifneq ($(LOCAL_PREBUILT_LIBS),)
$(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH))
endif
@@ -70,6 +72,12 @@
ifeq ($(DISABLE_RELOCATION_PACKER),true)
my_pack_module_relocations := false
endif
+
+ # Relocation packer does not work with LLD yet.
+ # my_use_clang_lld might be used befor set up in binary.mk
+ ifeq ($(my_use_clang_lld),true)
+ my_pack_module_relocations := false
+ endif
endif
ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)