zephyr/cmake/compiler/gcc/target_rx.cmake
Duy Nguyen f77e258cb9 cmake: Set RX build use 64bit doubles as default
The RX floating-point hardware only works on 32-bit values
so default gcc will build doubles as 32-bit, this make many
test fail on RX build test.
This commit force the build for RX arch to use 64-bit doubles
FPU will be supported later on this arch

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-05-22 23:57:26 +02:00

36 lines
1.1 KiB
CMake

# SPDX-License-Identifier: Apache-2.0
list(APPEND TOOLCHAIN_C_FLAGS)
list(APPEND TOOLCHAIN_C_FLAGS -mlittle-endian-data -ffunction-sections -fdata-sections -m64bit-doubles)
list(APPEND TOOLCHAIN_LD_FLAGS)
list(APPEND TOOLCHAIN_LD_FLAGS -mlittle-endian-data)
if(NOT CONFIG_PICOLIBC)
list(APPEND TOOLCHAIN_LD_FLAGS -lm)
endif()
if(NOT CONFIG_FPU)
list(APPEND TOOLCHAIN_C_FLAGS -nofpu)
endif()
if("cross-compile" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT})
if(CONFIG_CPU_RXV1)
list(APPEND TOOLCHAIN_C_FLAGS -misa=v1)
list(APPEND TOOLCHAIN_LD_FLAGS -misa=v1)
elseif(CONFIG_CPU_RXV2)
list(APPEND TOOLCHAIN_C_FLAGS -misa=v2)
list(APPEND TOOLCHAIN_LD_FLAGS -misa=v2)
else()
list(APPEND TOOLCHAIN_C_FLAGS -misa=v3)
list(APPEND TOOLCHAIN_LD_FLAGS -misa=v3)
endif()
elseif("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT})
if(CONFIG_SOC_SERIES_RX130)
list(APPEND TOOLCHAIN_C_FLAGS -mcpu=rx100)
list(APPEND TOOLCHAIN_LD_FLAGS -mcpu=rx100)
elseif(CONFIG_SOC_SERIES_RX62N)
list(APPEND TOOLCHAIN_C_FLAGS -mcpu=rx600)
list(APPEND TOOLCHAIN_LD_FLAGS -mcpu=rx600)
endif()
endif()