@@ -733,13 +733,17 @@ def link_program(self, r, tmp_path, name):
733
733
new_path = join (tmp_path , head )
734
734
mkdir (new_path )
735
735
736
+ # The output file names are derived from the project name, but this can have spaces in it which
737
+ # messes-up later processing. Replace any spaces in the derived names with '_'
738
+ tail = tail .replace (" " , "_" )
739
+
736
740
# Absolute path of the final linked file
737
741
if self .config .has_regions :
738
- elf = join (tmp_path , name + '_application.elf' )
739
- mapfile = join (tmp_path , name + '_application.map' )
742
+ elf = join (new_path , tail + '_application.elf' )
743
+ mapfile = join (new_path , tail + '_application.map' )
740
744
else :
741
- elf = join (tmp_path , name + '.elf' )
742
- mapfile = join (tmp_path , name + '.map' )
745
+ elf = join (new_path , tail + '.elf' )
746
+ mapfile = join (new_path , tail + '.map' )
743
747
744
748
objects = sorted (set (r .get_file_paths (FileType .OBJECT )))
745
749
config_file = ([self .config .app_config_location ]
@@ -768,21 +772,21 @@ def link_program(self, r, tmp_path, name):
768
772
if exists (old_mapfile ):
769
773
remove (old_mapfile )
770
774
rename (mapfile , old_mapfile )
771
- self .progress ("link" , name )
775
+ self .progress ("link" , tail )
772
776
self .link (elf , objects , libraries , lib_dirs , linker_script )
773
777
774
778
if self .config .has_regions :
775
- filename = "{}_application.{}" .format (name , ext )
779
+ filename = "{}_application.{}" .format (tail , ext )
776
780
else :
777
- filename = "{}.{}" .format (name , ext )
778
- full_path = join (tmp_path , filename )
781
+ filename = "{}.{}" .format (tail , ext )
782
+ full_path = join (new_path , filename )
779
783
if ext != 'elf' :
780
784
if full_path and self .need_update (full_path , [elf ]):
781
- self .progress ("elf2bin" , name )
785
+ self .progress ("elf2bin" , tail )
782
786
self .binary (r , elf , full_path )
783
787
if self .config .has_regions :
784
788
full_path , updatable = self ._do_region_merge (
785
- name , full_path , ext
789
+ tail , full_path , ext
786
790
)
787
791
else :
788
792
updatable = None
@@ -794,7 +798,7 @@ def link_program(self, r, tmp_path, name):
794
798
self ._get_toolchain_labels ()
795
799
)
796
800
if post_build_hook :
797
- self .progress ("post-build" , name )
801
+ self .progress ("post-build" , tail )
798
802
post_build_hook (self , r , elf , full_path )
799
803
# Initialize memap and process map file. This doesn't generate output.
800
804
self .mem_stats (mapfile )
0 commit comments