Correct gcc m33 floating point handling

pull/6146/head
Jimmy Brisson 2018-02-16 13:29:05 -06:00
parent ccff46d9a3
commit c29207a4f4
2 changed files with 19 additions and 16 deletions

View File

@ -337,8 +337,10 @@ class mbedToolchain:
"Cortex-A9" : ["__CORTEX_A9", "ARM_MATH_CA9", "__FPU_PRESENT", "__CMSIS_RTOS", "__EVAL", "__MBED_CMSIS_RTOS_CA9"],
"Cortex-M23-NS": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__DOMAIN_NS=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M23": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__DOMAIN_NS=1", "__FPU_PRESENT", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__FPU_PRESENT", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__DOMAIN_NS=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33F-NS": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__DOMAIN_NS=1", "__FPU_PRESENT", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M33F": ["__CORTEX_M33", "ARM_MATH_ARMV8MML", "__FPU_PRESENT", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
}
MBED_CONFIG_FILE_NAME="mbed_config.h"

View File

@ -49,21 +49,20 @@ class GCC(mbedToolchain):
self.flags["ld"].append("--specs=nano.specs")
if target.core == "Cortex-M0+":
cpu = "cortex-m0plus"
elif target.core == "Cortex-M4F":
cpu = "cortex-m4"
elif target.core == "Cortex-M7F":
cpu = "cortex-m7"
elif target.core == "Cortex-M7FD":
cpu = "cortex-m7"
elif target.core == "Cortex-M23-NS":
cpu = "cortex-m23"
elif target.core == "Cortex-M33-NS":
cpu = "cortex-m33"
self.cpu = ["-mcpu=cortex-m0plus"]
elif target.core.startswith("Cortex-M4"):
self.cpu = ["-mcpu=cortex-m4"]
elif target.core.startswith("Cortex-M7"):
self.cpu = ["-mcpu=cortex-m7"]
elif target.core.startswith("Cortex-M23"):
self.cpu = ["-mcpu=cortex-m23"]
elif target.core.startswith("Cortex-M33F"):
self.cpu = ["-mcpu=cortex-m33"]
elif target.core.startswith("Cortex-M33"):
self.cpu = ["-march=armv8-m.main"]
else:
cpu = target.core.lower()
self.cpu = ["-mcpu={}".format(target.core.lower())]
self.cpu = ["-mcpu=%s" % cpu]
if target.core.startswith("Cortex-M"):
self.cpu.append("-mthumb")
@ -86,7 +85,9 @@ class GCC(mbedToolchain):
self.cpu.append("-mfloat-abi=hard")
self.cpu.append("-mno-unaligned-access")
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
if ((target.core.startswith("Cortex-M23") or
target.core.startswith("Cortex-M33")) and
not target.core.endswith("-NS")):
self.cpu.append("-mcmse")
self.flags["common"] += self.cpu