From c243da02ed5c3612e70e0f5a4702903a87c55c7d Mon Sep 17 00:00:00 2001 From: David Leach Date: Thu, 17 Mar 2022 22:34:26 -0500 Subject: [PATCH] code_relocation: Move NOCOPY flag to avoid OS drive colon COPY/NOCOPY flag was added to the end of the string with ':' as separators. The python script then split the line on ':' which breaks on Windows build because the string was [MEM]:[FILE]:[COPY] In windows you will have 'c:\' in the file path so the line.split() in script will split on the 'c:'. Move the COPY/NOCOPY to: [MEM]:[COPY/NOCOPY]:[FILE] Note that the comments at top of gen_relocate_app.py also indicates this format. Fixes #43950 Signed-off-by: David Leach --- cmake/modules/extensions.cmake | 2 +- scripts/gen_relocate_app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index efcbb988181..b8b236f140d 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -1271,7 +1271,7 @@ function(zephyr_code_relocate file location) endif() set_property(TARGET code_data_relocation_target APPEND PROPERTY COMPILE_DEFINITIONS - "${location}:${file}:${copy_flag}") + "${location}:${copy_flag}:${file}") endfunction() # Usage: diff --git a/scripts/gen_relocate_app.py b/scripts/gen_relocate_app.py index 626cbc72c8b..ecdd8c04e42 100644 --- a/scripts/gen_relocate_app.py +++ b/scripts/gen_relocate_app.py @@ -418,7 +418,7 @@ def create_dict_wrt_mem(): if ':' not in line: continue - mem_region, file_name, copy_flag = line.split(':', 2) + mem_region, copy_flag, file_name = line.split(':', 2) file_name_list = glob.glob(file_name) if not file_name_list: