Skip to content

Commit

Permalink
Use cross build objcopy (#433)
Browse files Browse the repository at this point in the history
Resource embedding using the linker will failure when cross compiling. Use the cross build chain's objcopy instead of the host build tools' objcopy.

Signed-off-by: The MathWorks, Inc. Roy.Lurie@mathworks.com
  • Loading branch information
jeffdiclemente committed Jan 14, 2020
1 parent 9e82fc6 commit a924602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/usFunctionEmbedResources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function(usFunctionEmbedResources)
add_custom_command(
OUTPUT ${_source_output}
COMMAND ${CMAKE_LINKER} -r -b binary -o ${_source_output} ${_zip_archive_name}
COMMAND objcopy --rename-section .data=.us_resources,alloc,load,readonly,data,contents ${_source_output} ${_source_output}
COMMAND ${CMAKE_OBJCOPY} --rename-section .data=.us_resources,alloc,load,readonly,data,contents ${_source_output} ${_source_output}
DEPENDS ${_zip_archive}
WORKING_DIRECTORY ${_zip_archive_path}
COMMENT "Linking resources zip file for ${US_RESOURCE_TARGET}"
Expand Down

0 comments on commit a924602

Please sign in to comment.