Rules to enable LTO for Adreno GFX driver.
This patch controls rules when LTO is enabled for Adreno GFX driver. Change-Id: I45bd163889ffd3e0237d5451adaca0fc411b14f8
This commit is contained in:
committed by
Michael Bestas
parent
31eec2059a
commit
dc8df22add
30
build/core/sdllvm-lto-defs.mk
Normal file
30
build/core/sdllvm-lto-defs.mk
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
ARFLAGS := crsD
|
||||
|
||||
# For 32 bit
|
||||
$(LOCAL_BUILT_MODULE) : $(combo_2nd_arch_prefix)TARGET_AR := $(AR)
|
||||
$(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) : TARGET_AR := $(AR)
|
||||
$(LOCAL_BUILT_MODULE_64) : TARGET_GLOBAL_ARFLAGS := $(ARFLAGS)
|
||||
|
||||
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)
|
||||
intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX))
|
||||
linked_module_64 := $(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) : 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))
|
||||
|
||||
endif
|
@@ -953,7 +953,7 @@ if [ -d $(gettop)/prebuilts/snapdragon-llvm/toolchains ]; then
|
||||
*)
|
||||
export SDCLANG=true
|
||||
export SDCLANG_PATH=$(gettop)/prebuilts/snapdragon-llvm/toolchains/llvm-Snapdragon_LLVM_for_Android_3.8/prebuilt/linux-x86_64/bin
|
||||
export SDCLANG_LTO_DEFS=$(gettop)/device/qcom/common/sdllvm-lto-defs.mk
|
||||
export SDCLANG_LTO_DEFS=$(gettop)/vendor/lineage/build/core/sdllvm-lto-defs.mk
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
Reference in New Issue
Block a user