diff options
Diffstat (limited to 'pw_toolchain/arm_clang/BUILD.gn')
-rw-r--r-- | pw_toolchain/arm_clang/BUILD.gn | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/pw_toolchain/arm_clang/BUILD.gn b/pw_toolchain/arm_clang/BUILD.gn index 414b8569b..966014284 100644 --- a/pw_toolchain/arm_clang/BUILD.gn +++ b/pw_toolchain/arm_clang/BUILD.gn @@ -23,15 +23,29 @@ cortex_m_common_flags = [ cortex_m_software_fpu_flags = [ "-mfloat-abi=soft" ] -cortex_m_hardware_fpu_flags = [ +cortex_m_hardware_fpu_flags_common = [ "-mfloat-abi=hard", - "-mfpu=fpv4-sp-d16", # Used by some pigweed tests/targets to correctly handle hardware FPU # behavior. "-DPW_ARMV7M_ENABLE_FPU=1", ] +cortex_m_hardware_fpu_flags = + cortex_m_hardware_fpu_flags_common + [ "-mfpu=fpv4-sp-d16" ] + +cortex_m_hardware_fpu_v5_flags = + cortex_m_hardware_fpu_flags_common + [ "-mfpu=fpv5-d16" ] + +cortex_m_hardware_fpu_v5_sp_flags = + cortex_m_hardware_fpu_flags_common + [ "-mfpu=fpv5-sp-d16" ] + +# Default config added to all the ARM cortex M targets to link `nosys` library. +config("nosys") { + # TODO(prabhukr): libs = ["nosys"] did not work as expected (pwrev/133110). + ldflags = [ "-lnosys" ] +} + config("enable_float_printf") { ldflags = [ "-Wl,-u_printf_float" ] } @@ -52,6 +66,14 @@ pw_clang_arm_config("cortex_m3") { ldflags = cflags } +pw_clang_arm_config("cortex_m4") { + cflags = [ "-mcpu=cortex-m4" ] + cflags += cortex_m_common_flags + cflags += cortex_m_software_fpu_flags + asmflags = cflags + ldflags = cflags +} + pw_clang_arm_config("cortex_m4f") { cflags = [ "-mcpu=cortex-m4" ] cflags += cortex_m_common_flags @@ -59,3 +81,35 @@ pw_clang_arm_config("cortex_m4f") { asmflags = cflags ldflags = cflags } + +pw_clang_arm_config("cortex_m7") { + cflags = [ "-mcpu=cortex-m7" ] + cflags += cortex_m_common_flags + cflags += cortex_m_software_fpu_flags + asmflags = cflags + ldflags = cflags +} + +pw_clang_arm_config("cortex_m7f") { + cflags = [ "-mcpu=cortex-m7" ] + cflags += cortex_m_common_flags + cflags += cortex_m_hardware_fpu_v5_flags + asmflags = cflags + ldflags = cflags +} + +pw_clang_arm_config("cortex_m33") { + cflags = [ "-mcpu=cortex-m33" ] + cflags += cortex_m_common_flags + cflags += cortex_m_software_fpu_flags + asmflags = cflags + ldflags = cflags +} + +pw_clang_arm_config("cortex_m33f") { + cflags = [ "-mcpu=cortex-m33" ] + cflags += cortex_m_common_flags + cflags += cortex_m_hardware_fpu_v5_sp_flags + asmflags = cflags + ldflags = cflags +} |