mirror of https://github.com/ARMmbed/mbed-os.git
Use core arch for setting secure/non-secure flags
parent
bad1483a30
commit
1c5eb39b05
|
@ -425,27 +425,21 @@ class ARMC6(ARM_STD):
|
||||||
self.flags['common'].append("-mfpu=fpv5-sp-d16")
|
self.flags['common'].append("-mfpu=fpv5-sp-d16")
|
||||||
self.flags['common'].append("-mfloat-abi=hard")
|
self.flags['common'].append("-mfloat-abi=hard")
|
||||||
|
|
||||||
if ((target.core.startswith("Cortex-M23") or
|
if CORE_ARCH[target.core] == 8:
|
||||||
target.core.startswith("Cortex-M33")) and
|
# Add linking time preprocessor macro DOMAIN_NS
|
||||||
not target.core.endswith("-NS")):
|
if target.core.endswith("-NS"):
|
||||||
self.flags['cxx'].append("-mcmse")
|
define_string = self.make_ld_define("DOMAIN_NS", "0x1")
|
||||||
self.flags['c'].append("-mcmse")
|
self.flags["ld"].append(define_string)
|
||||||
|
else:
|
||||||
|
# Add secure build flag
|
||||||
|
self.flags['cxx'].append("-mcmse")
|
||||||
|
self.flags['c'].append("-mcmse")
|
||||||
|
|
||||||
# Create Secure library
|
if (not target.core.endswith("-NS")) and kwargs.get('build_dir', False):
|
||||||
if ((target.core.startswith("Cortex-M23") or
|
# Create Secure library
|
||||||
target.core.startswith("Cortex-M33")) and
|
build_dir = kwargs['build_dir']
|
||||||
not target.core.endswith("-NS") and
|
secure_file = join(build_dir, "cmse_lib.o")
|
||||||
kwargs.get('build_dir', False)):
|
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
|
||||||
build_dir = kwargs['build_dir']
|
|
||||||
secure_file = join(build_dir, "cmse_lib.o")
|
|
||||||
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
|
|
||||||
|
|
||||||
# Add linking time preprocessor macro DOMAIN_NS
|
|
||||||
if ((target.core.startswith("Cortex-M23") or
|
|
||||||
target.core.startswith("Cortex-M33")) and
|
|
||||||
target.core.endswith("-NS")):
|
|
||||||
define_string = self.make_ld_define("DOMAIN_NS", "0x1")
|
|
||||||
self.flags["ld"].append(define_string)
|
|
||||||
|
|
||||||
asm_cpu = {
|
asm_cpu = {
|
||||||
"Cortex-M0+": "Cortex-M0",
|
"Cortex-M0+": "Cortex-M0",
|
||||||
|
|
|
@ -20,6 +20,7 @@ from os import getenv
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
|
from tools.targets import CORE_ARCH
|
||||||
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
|
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
|
||||||
from tools.hooks import hook_tool
|
from tools.hooks import hook_tool
|
||||||
from tools.utils import run_cmd, NotSupportedException
|
from tools.utils import run_cmd, NotSupportedException
|
||||||
|
@ -94,20 +95,16 @@ class GCC(mbedToolchain):
|
||||||
self.cpu.append("-mfloat-abi=hard")
|
self.cpu.append("-mfloat-abi=hard")
|
||||||
self.cpu.append("-mno-unaligned-access")
|
self.cpu.append("-mno-unaligned-access")
|
||||||
|
|
||||||
if ((target.core.startswith("Cortex-M23") or
|
if CORE_ARCH[target.core] == 8:
|
||||||
target.core.startswith("Cortex-M33")) and
|
# Add linking time preprocessor macro DOMAIN_NS
|
||||||
not target.core.endswith("-NS")):
|
if target.core.endswith("-NS"):
|
||||||
self.cpu.append("-mcmse")
|
self.flags["ld"].append("-DDOMAIN_NS=1")
|
||||||
self.flags["ld"].extend([
|
else:
|
||||||
"-Wl,--cmse-implib",
|
self.cpu.append("-mcmse")
|
||||||
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
|
self.flags["ld"].extend([
|
||||||
])
|
"-Wl,--cmse-implib",
|
||||||
|
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
|
||||||
# Add linking time preprocessor macro DOMAIN_NS
|
])
|
||||||
if ((target.core.startswith("Cortex-M23") or
|
|
||||||
target.core.startswith("Cortex-M33")) and
|
|
||||||
target.core.endswith("-NS")):
|
|
||||||
self.flags["ld"].append("-DDOMAIN_NS=1")
|
|
||||||
|
|
||||||
self.flags["common"] += self.cpu
|
self.flags["common"] += self.cpu
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue