diff --git a/sdclang/sdllvm-lto-defs.mk b/sdclang/sdllvm-lto-defs.mk index 89ef44ba..0d202bd9 100644 --- a/sdclang/sdllvm-lto-defs.mk +++ b/sdclang/sdllvm-lto-defs.mk @@ -2,6 +2,11 @@ ifeq ($(LOCAL_MODULE_CLASS), STATIC_LIBRARIES) # For STATIC_LIBRARIES we need to use SD LLVM's archiver and archiver flags. AR := $(SDCLANG_PATH)/llvm-ar + +ifeq ($(LOCAL_SDCLANG_2),true) +AR := $(SDCLANG_PATH_2)/llvm-ar +endif + ARFLAGS := crsD # For 32 bit @@ -10,7 +15,7 @@ $(LOCAL_BUILT_MODULE) : $(combo_var_prefix)GLOBAL_ARFLAGS := $(ARFLAGS) # For 64 bit intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX)) -LOCAL_BUILT_MODULE_64 := $(intermediates)/$(my_built_module_stem) +LOCAL_BUILT_MODULE_64 := $(intermediates)/$(my_installed_module_stem) $(LOCAL_BUILT_MODULE_64) : TARGET_AR := $(AR) $(LOCAL_BUILT_MODULE_64) : TARGET_GLOBAL_ARFLAGS := $(ARFLAGS) @@ -19,17 +24,11 @@ else # For SHARED_LIBRARIES and EXECUTABLES we need to filter out flags not # needed/understood by SD LLVM's Linker. -linked_module_32 := $(intermediates)/LINKED/$(my_built_module_stem) +FLAGS_TO_BE_FILTERED := -Wl,--icf=safe -Wl,--no-undefined-version -Wl,--fix-cortex-a53-843419 -fuse-ld=gold +linked_module_32 := $(intermediates)/LINKED/$(my_installed_module_stem) intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX)) -linked_module_64 := $(intermediates)/LINKED/$(my_built_module_stem) +linked_module_64 := $(intermediates)/LINKED/$(my_installed_module_stem) -FLAGS_TO_BE_FILTERED := -Wl,--icf=safe -Wl,--no-undefined-version -Wl,--fix-cortex-a53-843419 -Wl,--no-fix-cortex-a53-843419 -Wl,--fix-cortex-a53-835769 -Wl,--no-fix-cortex-a53-835769 -fuse-ld=gold $(linked_module_32) : PRIVATE_TARGET_GLOBAL_LDFLAGS := $(filter-out $(FLAGS_TO_BE_FILTERED),$(PRIVATE_TARGET_GLOBAL_LDFLAGS)) $(linked_module_64) : PRIVATE_TARGET_GLOBAL_LDFLAGS := $(filter-out $(FLAGS_TO_BE_FILTERED),$(PRIVATE_TARGET_GLOBAL_LDFLAGS)) - -ifeq ($(LOCAL_SDCLANG_LTO_UNSAFE_FILTER), true) -$(linked_module_32) : PRIVATE_LDFLAGS := $(filter-out $(FLAGS_TO_BE_FILTERED),$(PRIVATE_LDFLAGS)) -$(linked_module_64) : PRIVATE_LDFLAGS := $(filter-out $(FLAGS_TO_BE_FILTERED),$(PRIVATE_LDFLAGS)) -endif - endif