diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index 6697524c6596ae..d593f16fd7b2dd 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -34,7 +34,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) "${TOOLSET_PREFIX}${exec}") if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") - message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.") + message(FATAL_ERROR "Unable to find toolchain executable. Name: '${exec}', Prefix: '${TOOLSET_PREFIX}.'") endif() set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) endfunction() @@ -49,17 +49,16 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS)) locate_toolchain_exec(objdump CMAKE_OBJDUMP) + locate_toolchain_exec(objcopy CMAKE_OBJCOPY) + if(CLR_CMAKE_TARGET_ANDROID) set(TOOLSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX}) elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv8l|armv7l|armv6l|aarch64|arm|s390x|ppc64le)$") set(TOOLSET_PREFIX "${TOOLCHAIN}-") - else() - set(TOOLSET_PREFIX "") endif() - locate_toolchain_exec(objcopy CMAKE_OBJCOPY) endif() endif() diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 6a8c8f24e9a79c..9831cad8ab5eb2 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -427,7 +427,7 @@ function(strip_symbols targetName outputFilename) POST_BUILD VERBATIM COMMAND ${CMAKE_OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file} - COMMAND ${CMAKE_OBJCOPY} --strip-unneeded ${strip_source_file} + COMMAND ${CMAKE_OBJCOPY} --strip-debug --strip-unneeded ${strip_source_file} COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file} COMMENT "Stripping symbols from ${strip_source_file} into file ${strip_destination_file}" )