Skip to content

Commit ef7b466

Browse files
committed
Correct cmse lib creation for the make_gcc_arm
1 parent c669655 commit ef7b466

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/toolchains/gcc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
9191
target.core.startswith("Cortex-M33")) and
9292
not target.core.endswith("-NS")):
9393
self.cpu.append("-mcmse")
94+
self.flags["ld"].extend([
95+
"-Wl,--cmse-implib",
96+
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
97+
])
9498
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS":
9599
self.flags["ld"].append("-D__DOMAIN_NS=1")
96100

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

242241
if mem_map:
243242
cmd.extend(['-T', mem_map])

0 commit comments

Comments
 (0)