Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use llvm-objcopy for regular and cross builds #71446

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand Down