Skip to content
Permalink
Browse files

soc: arc: optmize and bug fix the compile options

* when -mcpu is given, e.g. -mcpu=em4_dmips,-mnorm,-mdiv_em
etc. are already given, no need to duplicate

* use zephyr_compiler_options to replace zephyr_cc_option
zephyr_cc_option will do compile option check first then add
the checked options into option list. It's too strict that makes
options like -mfpu, -mmpy-option cannot be added.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information...
vonhust authored and nashif committed Jun 17, 2019
1 parent 27fbe34 commit 54b229fc422d9dc8f57b765d891fb3d0bdbf4a9f
Showing with 10 additions and 31 deletions.
  1. +2 −9 soc/arc/snps_arc_iot/CMakeLists.txt
  2. +6 −12 soc/arc/snps_emsk/CMakeLists.txt
  3. +2 −10 soc/arc/snps_nsim/CMakeLists.txt
@@ -1,13 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)

zephyr_cc_option(-mcpu=${GCC_M_CPU})
zephyr_cc_option(-mno-sdata -mdiv-rem -mswap -mnorm)
zephyr_cc_option(-mmpy-option=6 -mbarrel-shifter)
zephyr_cc_option_ifdef(CONFIG_CODE_DENSITY -mcode-density)
zephyr_cc_option_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)

zephyr_compile_options(-mcpu=${GCC_M_CPU} -mno-sdata -mmpy-option=6)
zephyr_compile_options_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)

zephyr_sources(
soc.c
@@ -1,17 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_compile_options(-mcpu=${GCC_M_CPU} -mno-sdata -mmpy-option=6)

zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)

zephyr_cc_option(-mcpu=${GCC_M_CPU})
zephyr_cc_option(-mno-sdata -mdiv-rem -mswap -mnorm)
zephyr_cc_option(-mmpy-option=6 -mbarrel-shifter)
zephyr_cc_option_ifdef(CONFIG_SOC_EMSK_EM7D --param l1-cache-size=16384)
zephyr_cc_option_ifdef(CONFIG_SOC_EMSK_EM7D --param l1-cache-line-size=32)
zephyr_cc_option_ifdef(CONFIG_SOC_EMSK_EM11D --param l1-cache-size=16384)
zephyr_cc_option_ifdef(CONFIG_SOC_EMSK_EM11D --param l1-cache-line-size=32)
zephyr_cc_option_ifdef(CONFIG_CODE_DENSITY -mcode-density)
zephyr_cc_option_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)

if(CONFIG_SOC_EMSK_EM9D)
zephyr_compile_options_ifdef(CONFIG_FLOAT -mfpu=fpus_all)
elseif(CONFIG_SOC_EMSK_EM11D)
zephyr_compile_options_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)
endif()

zephyr_sources(
soc.c
@@ -1,14 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)

zephyr_cc_option(-mcpu=${GCC_M_CPU})
zephyr_cc_option(-mno-sdata -mdiv-rem -mswap -mnorm)
zephyr_cc_option(-mmpy-option=6 -mbarrel-shifter)
zephyr_cc_option(--param l1-cache-size=16384)
zephyr_cc_option(--param l1-cache-line-size=32)
zephyr_cc_option_ifdef(CONFIG_CODE_DENSITY -mcode-density)
zephyr_cc_option_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)
zephyr_compile_options(-mcpu=${GCC_M_CPU} -mno-sdata -mmpy-option=6)
zephyr_compile_options_ifdef(CONFIG_FLOAT -mfpu=fpuda_all)

zephyr_sources(
soc.c

0 comments on commit 54b229f

Please sign in to comment.
You can’t perform that action at this time.