Skip to content

Build tool fixes for Musca support #7792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tools/profiles/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--verbose", "--remove", "--legacyalign", "--no_strict_wchar_size",
"--no_strict_enum_size", "--show_full_path"]
"ld": ["--verbose", "--remove", "--show_full_path"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand Down
2 changes: 1 addition & 1 deletion tools/profiles/develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--legacyalign", "--no_strict_wchar_size", "--no_strict_enum_size", "--show_full_path"]
"ld": ["--show_full_path"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand Down
3 changes: 1 addition & 2 deletions tools/profiles/release.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--legacyalign", "--no_strict_wchar_size", "--no_strict_enum_size",
"--show_full_path"]
"ld": ["--show_full_path"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
Expand Down
22 changes: 12 additions & 10 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class ARMC6(ARM_STD):
SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4",
"Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD",
"Cortex-M23", "Cortex-M23-NS", "Cortex-M33",
"CortexM33-NS", "Cortex-A9"]
"Cortex-M33-NS", "Cortex-A9"]
ARMCC_RANGE = (LooseVersion("6.10"), LooseVersion("7.0"))

@staticmethod
Expand Down Expand Up @@ -393,11 +393,11 @@ def __init__(self, target, *args, **kwargs):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-1])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-1])
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-1]
elif target.core.lower().endswith("ns"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-3])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-3])
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-3]
else:
elif target.core.startswith("Cortex-M33"):
self.flags['common'].append("-mcpu=cortex-m33+nodsp")
self.flags['common'].append("-mfpu=none")
self.flags['ld'].append("--cpu=Cortex-M33.no_dsp.no_fp")
elif not target.core.startswith("Cortex-M23"):
self.flags['common'].append("-mcpu=%s" % target.core.lower())
self.flags['ld'].append("--cpu=%s" % target.core.lower())
self.SHEBANG += " -mcpu=%s" % target.core.lower()
Expand All @@ -413,11 +413,10 @@ def __init__(self, target, *args, **kwargs):
self.flags['common'].append("-mfloat-abi=softfp")
elif target.core.startswith("Cortex-M23"):
self.flags['common'].append("-march=armv8-m.base")
elif target.core.startswith("Cortex-M33"):
self.flags['common'].append("-march=armv8-m.main")

if target.core == "Cortex-M23" or target.core == "Cortex-M33":
self.flags['common'].append("-mcmse")
self.flags['cxx'].append("-mcmse")
self.flags['c'].append("-mcmse")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be added to common?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag gives warning with linker and armasm.


# Create Secure library
if ((target.core == "Cortex-M23" or self.target.core == "Cortex-M33") and
Expand All @@ -438,7 +437,10 @@ def __init__(self, target, *args, **kwargs):
"Cortex-M23-NS": "Cortex-M23",
"Cortex-M33-NS": "Cortex-M33" }.get(target.core, target.core)

self.flags['asm'].append("--cpu=%s" % asm_cpu)
if target.core.startswith("Cortex-M33"):
self.flags['asm'].append("--cpu=Cortex-M33.no_dsp.no_fp")
else :
self.flags['asm'].append("--cpu=%s" % asm_cpu)

self.cc = ([join(TOOLCHAIN_PATHS["ARMC6"], "armclang")] +
self.flags['common'] + self.flags['c'])
Expand Down
2 changes: 0 additions & 2 deletions tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
# Exec command
self.notify.cc_verbose("Link: %s" % ' '.join(cmd))
self.default_cmd(cmd)
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this output no longer needed? (Commit only mentioned something about a build issue)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code for creation of ‘secure_file’ was initially in this section and later moved to other part. Variable ‘secure_file’ is not available here and hence throws error

self.notify.info("Secure Library Object %s" %secure_file)

@hook_tool
def archive(self, objects, lib_path):
Expand Down