This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a832eb554 xtensa: enable -Oz for xtensa to reduce codesize
1a832eb554 is described below

commit 1a832eb554f6f7e504698138922935b51554872f
Author: hanqiyuan <[email protected]>
AuthorDate: Sun Aug 20 22:36:56 2023 +0800

    xtensa: enable -Oz for xtensa to reduce codesize
---
 arch/xtensa/Kconfig                | 2 +-
 arch/xtensa/src/lx7/Toolchain.defs | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 48ff80958e..e74a095b96 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -307,7 +307,7 @@ config XTENSA_TOOLCHAIN_XCC
 
 config XTENSA_TOOLCHAIN_XCLANG
        bool "Xtensa Toolchain use CLANG as front end"
-       select ARCH_TOOLCHAIN_GNU
+       select ARCH_TOOLCHAIN_CLANG
 
 config XTENSA_TOOLCHAIN_ESP
        bool "ESP toolchain for xtensa"
diff --git a/arch/xtensa/src/lx7/Toolchain.defs 
b/arch/xtensa/src/lx7/Toolchain.defs
index 0f9bef98c5..f8719643fe 100644
--- a/arch/xtensa/src/lx7/Toolchain.defs
+++ b/arch/xtensa/src/lx7/Toolchain.defs
@@ -58,7 +58,11 @@ endif
 ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
   ARCHOPTIMIZATION += $(CONFIG_DEBUG_OPTLEVEL)
 else ifeq ($(CONFIG_DEBUG_FULLOPT),y)
-  ARCHOPTIMIZATION += -Os
+  ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
+    ARCHOPTIMIZATION += -Oz
+  else
+    ARCHOPTIMIZATION += -Os
+  endif
 endif
 
 ifneq ($(CONFIG_DEBUG_NOOPT),y)

Reply via email to