Skip to content

Commit 3c21f1e

Browse files
committed
ARM: ARMC6: Fix for ARM linker script cpu formatting
1 parent 453a1d7 commit 3c21f1e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/toolchains/arm.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(self, target, notify=None, macros=None,
8181
self.ar = join(ARM_BIN, "armar")
8282
self.elf2bin = join(ARM_BIN, "fromelf")
8383

84-
self.SHEBANG += " --cpu=%s" % target.core.lower()
84+
self.SHEBANG += " --cpu=%s" % cpu
8585

8686
def parse_dependencies(self, dep_path):
8787
dependencies = []
@@ -312,15 +312,19 @@ def __init__(self, target, *args, **kwargs):
312312
if target.core.lower().endswith("fd"):
313313
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-2])
314314
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-2])
315+
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-2]
315316
elif target.core.lower().endswith("f"):
316317
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-1])
317318
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-1])
319+
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-1]
318320
elif target.core.lower().endswith("ns"):
319321
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-3])
320322
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-3])
323+
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-3]
321324
else:
322325
self.flags['common'].append("-mcpu=%s" % target.core.lower())
323326
self.flags['ld'].append("--cpu=%s" % target.core.lower())
327+
self.SHEBANG += " -mcpu=%s" % target.core.lower()
324328

325329
if target.core == "Cortex-M4F":
326330
self.flags['common'].append("-mfpu=fpv4-sp-d16")
@@ -358,8 +362,6 @@ def __init__(self, target, *args, **kwargs):
358362
self.ar = [join(TOOLCHAIN_PATHS["ARMC6"], "armar")]
359363
self.elf2bin = join(TOOLCHAIN_PATHS["ARMC6"], "fromelf")
360364

361-
self.SHEBANG += " -mcpu=%s" % target.core.lower()
362-
363365
def parse_dependencies(self, dep_path):
364366
return mbedToolchain.parse_dependencies(self, dep_path)
365367

0 commit comments

Comments
 (0)