Only store references to one linker script in a resources object.

Projects have only ever made use of one linker script per compiler.
However, the tools would store references to multiple linker scripts in
a project and select one in a non-deterministic way. Now we clear out
any existing linker script when we add a new one to a project. This way,
the last added linker script is always used.
pull/9966/head
Brian Daniels 2019-04-02 09:49:06 -05:00
parent fd7467c9ba
commit 3b9baf9600
1 changed files with 4 additions and 0 deletions

View File

@ -269,6 +269,10 @@ class Resources(object):
if file_type:
if sep != self._sep:
file_name = file_name.replace(sep, self._sep)
# Mbed OS projects only use one linker script at a time, so remove
# any existing linker script when adding a new one
if file_type == FileType.LD_SCRIPT:
self._file_refs[file_type].clear()
self._file_refs[file_type].add(FileRef(file_name, file_path))
def _include_file(self, ref):