-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
Any linker scripts defined by a target are put through the C preprocessor before linking. Unfortunately, the macro definitions from config and COMPONENT/FEATURE/TARGET are not included in this process, which limits the usefulness of this.
I patched around a bit, and if I change to the following in gcc.py in the link() function, it works as expected:
# Preprocess
if mem_map:
preproc_output = join(dirname(output), ".link_script.ld")
cmd = (
self.preproc + [mem_map] + self.ld[1:] + ["-o", preproc_output] +
self.get_compile_options(self.get_symbols(), [])
)
self.notify.cc_verbose("Preproc: %s" % ' '.join(cmd))
self.default_cmd(cmd)
mem_map = preproc_output
Would this be something that can be patched into mbed?
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug