Correct path usage in linking

pull/7183/head
Jimmy Brisson 2018-06-18 11:37:39 -05:00
parent d8ddfdc5a5
commit 28dbbd6b3b
1 changed files with 5 additions and 3 deletions

View File

@ -628,18 +628,20 @@ class mbedToolchain:
bin = None if ext == 'elf' else full_path bin = None if ext == 'elf' else full_path
map = join(tmp_path, name + '.map') map = join(tmp_path, name + '.map')
objects = sorted(set(r.objects)) objects = sorted(set([path for _, path
in r.get_file_refs(FileType.OBJECT)]))
config_file = ([self.config.app_config_location] config_file = ([self.config.app_config_location]
if self.config.app_config_location else []) if self.config.app_config_location else [])
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT) linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
if path.endswith(self.LINKER_EXT)][-1] if path.endswith(self.LINKER_EXT)][-1]
lib_dirs = [path for _, path in r.get_file_refs(FileType.LIB_DIR)] lib_dirs = [path for _, path in r.get_file_refs(FileType.LIB_DIR)]
dependencies = objects + r.libraries + [linker_script] + config_file libraries = [path for _, path in r.get_file_refs(FileType.LIB)]
dependencies = objects + libraries + [linker_script] + config_file
dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld")) dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld"))
if self.need_update(elf, dependencies): if self.need_update(elf, dependencies):
needed_update = True needed_update = True
self.progress("link", name) self.progress("link", name)
self.link(elf, objects, r.libraries, lib_dirs, linker_script) self.link(elf, objects, libraries, lib_dirs, linker_script)
if bin and self.need_update(bin, [elf]): if bin and self.need_update(bin, [elf]):
needed_update = True needed_update = True