mirror of https://github.com/ARMmbed/mbed-os.git
Use paths in linking
parent
4109aa52e6
commit
7a26cd8da8
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue