# SPDX-License-Identifier: Apache-2.0

if(EXISTS ${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
  include(${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
endif()

if(NOT DEFINED GCC_ARC_TUNED_CPU)
  set(GCC_ARC_TUNED_CPU ${GCC_M_CPU})
endif()

list(APPEND TOOLCHAIN_C_FLAGS -mcpu=${GCC_ARC_TUNED_CPU})


# SPDX-License-Identifier: Apache-2.0

if(EXISTS ${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
  include(${SOC_DIR}/${ARCH}/${SOC_PATH}/tune_build_ops.cmake)
endif()

if(NOT DEFINED GCC_ARC_TUNED_CPU)
  set(GCC_ARC_TUNED_CPU ${GCC_M_CPU})
endif()

list(APPEND TOOLCHAIN_C_FLAGS -mcpu=${GCC_ARC_TUNED_CPU})
list(APPEND TOOLCHAIN_LD_FLAGS -mcpu=${GCC_ARC_TUNED_CPU})

Add -mcpu flag to TOOLCHAIN_LD_FLAGS
arch/arc: Add -mcpu flag to TOOLCHAIN_LD_FLAGS

Make sure the linker knows what the target is, in case it needs to find
additional target-specific libraries (like picolibc).

Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>
