Skip to content

Commit

Permalink
Merge pull request #7500 from theotherjimmy/fix-gcc-v8m-export
Browse files Browse the repository at this point in the history
Tools: Correct cmse lib creating with make_gcc_arm exporter
  • Loading branch information
Cruz Monrreal committed Jul 14, 2018
2 parents 1ee7d8b + ef7b466 commit 9667b5e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
target.core.startswith("Cortex-M33")) and
not target.core.endswith("-NS")):
self.cpu.append("-mcmse")
self.flags["ld"].extend([
"-Wl,--cmse-implib",
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
])
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS":
self.flags["ld"].append("-D__DOMAIN_NS=1")

Expand Down Expand Up @@ -233,11 +237,6 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
# Build linker command
map_file = splitext(output)[0] + ".map"
cmd = self.ld + ["-o", output, "-Wl,-Map=%s" % map_file] + objects + ["-Wl,--start-group"] + libs + ["-Wl,--end-group"]
# Create Secure library
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
secure_file = join(dirname(output), "cmse_lib.o")
cmd.extend(["-Wl,--cmse-implib"])
cmd.extend(["-Wl,--out-implib=%s" % secure_file])

if mem_map:
cmd.extend(['-T', mem_map])
Expand Down

0 comments on commit 9667b5e

Please sign in to comment.