diff options
author | Geunsik Lim <geunsik.lim@samsung.com> | 2016-03-26 21:39:14 +0900 |
---|---|---|
committer | Geunsik Lim <geunsik.lim@samsung.com> | 2016-03-28 16:18:40 +0900 |
commit | 2df33a8de217f54330397a9101c51f2a9956ad18 (patch) | |
tree | 9ee29eafda0d21157e22a9e9229f9d972786b1c1 /CMakeLists.txt | |
parent | 48ce56b9fcd1b5edf5ca28f83d7b623b71e5c925 (diff) | |
download | coreclr-2df33a8de217f54330397a9101c51f2a9956ad18.tar.gz coreclr-2df33a8de217f54330397a9101c51f2a9956ad18.tar.bz2 coreclr-2df33a8de217f54330397a9101c51f2a9956ad18.zip |
objcopy: Support cross-build for stripping symbols
Currently, the 'objcopy' does only support native-build since
the commit number 4efef62f0ead16b4f8ca2c6ccf0a77ce112f73b9
Let's add cross-build as well as native-build to strip symbols.
v3:
- support if statement for arm64
v2:
- Replace 'EQUAL' with 'DEFINED' for handling Other Linux distributions
as well as Ubuntu 14.04 and for handling in case of native-build.
v2:
- support cross-build to strip debug symbols of native arm binaries
Signed-off-by: Geunsik Lim geunsik.lim@samsung.com
Signed-off-by: MyungJoo Ham myungjoo.ham@samsung.com
Signed-off-by: Prajwal A N an.prajwal@samsung.com
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c9da3675a0..d0f3f54389 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,15 +166,23 @@ else() if (STRIP STREQUAL "STRIP-NOTFOUND") message(FATAL_ERROR "strip not found") endif() - - else (CMAKE_SYSTEM_NAME STREQUAL Darwin) - + elseif (CMAKE_SYSTEM_NAME STREQUAL Linux) # Ensure that objcopy is present - find_program(OBJCOPY objcopy) + if(DEFINED ENV{CROSSCOMPILE}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l) + find_program(OBJCOPY arm-linux-gnueabihf-objcopy) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) + find_program(OBJCOPY aarch64-linux-gnu-objcopy) + else() + clr_unknown_arch() + endif() + else() + find_program(OBJCOPY objcopy) + endif() if (OBJCOPY STREQUAL "OBJCOPY-NOTFOUND") message(FATAL_ERROR "objcopy not found") endif() - endif (CMAKE_SYSTEM_NAME STREQUAL Darwin) + endif () endif(WIN32) # Build a list of compiler definitions by putting -D in front of each define. @@ -287,7 +295,7 @@ function(strip_symbols targetName outputFilename) COMMAND ${STRIP} -u -r ${strip_source_file} COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file} ) - else(CMAKE_SYSTEM_NAME STREQUAL Darwin) + elseif(CMAKE_SYSTEM_NAME STREQUAL Linux) set(strip_destination_file ${strip_source_file}.dbg) add_custom_command( |