Skip to content

Commit 28dbbd6

Browse files
committed
Correct path usage in linking
1 parent d8ddfdc commit 28dbbd6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/toolchains/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,18 +628,20 @@ def link_program(self, r, tmp_path, name):
628628
bin = None if ext == 'elf' else full_path
629629
map = join(tmp_path, name + '.map')
630630

631-
objects = sorted(set(r.objects))
631+
objects = sorted(set([path for _, path
632+
in r.get_file_refs(FileType.OBJECT)]))
632633
config_file = ([self.config.app_config_location]
633634
if self.config.app_config_location else [])
634635
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
635636
if path.endswith(self.LINKER_EXT)][-1]
636637
lib_dirs = [path for _, path in r.get_file_refs(FileType.LIB_DIR)]
637-
dependencies = objects + r.libraries + [linker_script] + config_file
638+
libraries = [path for _, path in r.get_file_refs(FileType.LIB)]
639+
dependencies = objects + libraries + [linker_script] + config_file
638640
dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld"))
639641
if self.need_update(elf, dependencies):
640642
needed_update = True
641643
self.progress("link", name)
642-
self.link(elf, objects, r.libraries, lib_dirs, linker_script)
644+
self.link(elf, objects, libraries, lib_dirs, linker_script)
643645

644646
if bin and self.need_update(bin, [elf]):
645647
needed_update = True

0 commit comments

Comments
 (0)