Skip to content

Commit 9f096cf

Browse files
hug-devcmonr
authored andcommitted
Fix a bug using ELF as output extension
When overriding the OUTPUT_EXT variable in compilation configuration, bugs appear: * The bin variable is not None as the 'elf' string is not interned. * When that is fixed, the function returns None instead of returning the path of the ELF file. Signed-off-by: Hugues de Valon <[email protected]>
1 parent da9a49f commit 9f096cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/toolchains/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,10 @@ def link_program(self, r, tmp_path, name):
11271127
mkdir(new_path)
11281128

11291129
filename = name+'.'+ext
1130+
# Absolute path of the final linked file
1131+
full_path = join(tmp_path, filename)
11301132
elf = join(tmp_path, name + '.elf')
1131-
bin = None if ext is 'elf' else join(tmp_path, filename)
1133+
bin = None if ext == 'elf' else full_path
11321134
map = join(tmp_path, name + '.map')
11331135

11341136
r.objects = sorted(set(r.objects))
@@ -1152,7 +1154,7 @@ def link_program(self, r, tmp_path, name):
11521154
self.var("compile_succeded", True)
11531155
self.var("binary", filename)
11541156

1155-
return bin, needed_update
1157+
return full_path, needed_update
11561158

11571159
# THIS METHOD IS BEING OVERRIDDEN BY THE MBED ONLINE BUILD SYSTEM
11581160
# ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY

0 commit comments

Comments
 (0)