Call lld with --pack-dyn-relocs=none if my_pack_module_relocations is false

* Factor out the logic that sets up my_pack_module_relocations
  from dynamic_binary.mk to pack_dyn_relocs_setup.mk.
* Use stand-alone relocation_packer only if my_pack_module_relocations
  is true and my_use_clang_lld is false.

Bug: 80093890
Bug: 73768157
Test: build and boot with USE_CLANG_LLD=true
Change-Id: I7c4b5fcdce0754c57cff4acf86185cac65a26c40
This commit is contained in:
Chih-Hung Hsieh
2018-05-24 15:13:19 -07:00
parent d48f2a1408
commit 289e8d6011
3 changed files with 48 additions and 28 deletions

View File

@@ -519,6 +519,10 @@ my_target_global_conlyflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)G
my_target_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_CPPFLAGS) $(my_cpp_std_cppflags)
ifeq ($(my_use_clang_lld),true)
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_LLDFLAGS)
include $(BUILD_SYSTEM)/pack_dyn_relocs_setup.mk
ifeq ($(my_pack_module_relocations),false)
my_target_global_ldflags += -Wl,--pack-dyn-relocs=none
endif
else
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_LDFLAGS)
endif # my_use_clang_lld