From 7797f017a2c07d89a47ba2467ed0131b53fc1d4d Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Thu, 31 Dec 2020 17:56:06 +0800 Subject: [PATCH] Disable LTO only for Qemu ARM build Keep flag enabled for HiSi cameras whereas LTO will be disabled for Qemu as a workaround. Signed-off-by: Zbigniew Bodek Change-Id: Iad7295d108dfea0928537281f87eb46836ee6681 --- tools/build/mk/los_config.mk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index 5839d3e5..2fc434d2 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -463,10 +463,14 @@ ifeq ($(LOSCFG_COMPILE_DEBUG), y) LITEOS_COPTS_OPTION = -g -gdwarf-2 else ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) - # WORKAROUND: Disable LTO to avoid undefined __stack_chk_guard - # problem. "externally_visible" attribute could be - # a fix for that but it is not known to our LLVM. - LITEOS_COPTS_OPTMIZE = -Oz #-flto + ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) + # WORKAROUND: Disable LTO to avoid undefined __stack_chk_guard + # problem. "externally_visible" attribute could be + # a fix for that but it is not known to our LLVM. + LITEOS_COPTS_OPTMIZE = -Oz #-flto + else + LITEOS_COPTS_OPTMIZE = -Oz -flto + endif else LITEOS_COPTS_OPTMIZE = -O2 endif -- GitLab