Use paths in linking

pull/7183/head
Jimmy Brisson 2018-06-13 14:41:52 -05:00
parent 4109aa52e6
commit 7a26cd8da8
3 changed files with 7 additions and 4 deletions

View File

@ -525,7 +525,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
# Change linker script if specified
if linker_script is not None:
resources.linker_script = linker_script
resources.add_file_ref(linker_script, linker_script)
# Compile Sources
objects = toolchain.compile_sources(resources, resources.inc_dirs)

View File

@ -321,7 +321,7 @@ class Resources(object):
@property
def linker_script(self):
return self.get_file_names(FileType.LD_SCRIPT)[0]
return self.get_file_names(FileType.LD_SCRIPT)[-1]
@property
def hex_files(self):

View File

@ -631,12 +631,15 @@ class mbedToolchain:
objects = sorted(set(r.objects))
config_file = ([self.config.app_config_location]
if self.config.app_config_location else [])
dependencies = objects + r.libraries + [r.linker_script] + config_file
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
if path.endswith(self.LINKER_EXT)][-1]
lib_dirs = [path for _, path in r.get_file_refs(FileType.LIB_DIR)]
dependencies = objects + r.libraries + [linker_script] + config_file
dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld"))
if self.need_update(elf, dependencies):
needed_update = True
self.progress("link", name)
self.link(elf, objects, r.libraries, r.lib_dirs, r.linker_script)
self.link(elf, objects, r.libraries, lib_dirs, linker_script)
if bin and self.need_update(bin, [elf]):
needed_update = True