Skip to content

Commit b0027c1

Browse files
committed
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 ccff46d commit b0027c1

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
@@ -1129,8 +1129,10 @@ def link_program(self, r, tmp_path, name):
11291129
mkdir(new_path)
11301130

11311131
filename = name+'.'+ext
1132+
# Absolute path of the final linked file
1133+
full_path = join(tmp_path, filename)
11321134
elf = join(tmp_path, name + '.elf')
1133-
bin = None if ext is 'elf' else join(tmp_path, filename)
1135+
bin = None if ext == 'elf' else full_path
11341136
map = join(tmp_path, name + '.map')
11351137

11361138
r.objects = sorted(set(r.objects))
@@ -1154,7 +1156,7 @@ def link_program(self, r, tmp_path, name):
11541156
self.var("compile_succeded", True)
11551157
self.var("binary", filename)
11561158

1157-
return bin, needed_update
1159+
return full_path, needed_update
11581160

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

0 commit comments

Comments
 (0)