[PATCH] D18308: cmake/lit: Use CMAKE_STRIP variable to provide strip tool name to hash.py

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 20 23:50:43 PDT 2016


atanasyan created this revision.
atanasyan added reviewers: jmolloy, MatzeB.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.

Host `strip` tool cannot recognize binary format of files built for another target architecture. The patch allows to override default `strip` tool name using `CMAKE_STRIP` configuration variable.

Repository:
  rL LLVM

http://reviews.llvm.org/D18308

Files:
  CMakeLists.txt
  lit.site.cfg.in
  litsupport/hash.py

Index: litsupport/hash.py
===================================================================
--- litsupport/hash.py
+++ litsupport/hash.py
@@ -15,7 +15,7 @@
         if platform.system() != 'Darwin':
             stripped_executable = executable + '.stripped'
             shutil.copyfile(executable, stripped_executable)
-            subprocess.check_call(['strip',
+            subprocess.check_call([context.config.strip_tool,
                                    '--remove-section=.comment',
                                    "--remove-section='.note*'",
                                    stripped_executable])
Index: lit.site.cfg.in
===================================================================
--- lit.site.cfg.in
+++ lit.site.cfg.in
@@ -7,6 +7,7 @@
 config.remote_user = "@TEST_SUITE_REMOTE_USER@"
 config.remote_port = "@TEST_SUITE_REMOTE_PORT@"
 config.run_under = "@TEST_SUITE_RUN_UNDER@"
+config.strip_tool = "@CMAKE_STRIP@"
 config.profile_generate = @TEST_SUITE_PROFILE_GENERATE@
 config.llvm_profdata = "@TEST_SUITE_LLVM_PROFDATA@"
 
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -78,6 +78,11 @@
 set(TEST_SUITE_RUN_TYPE "train" CACHE STRING
     "Type of benchmark inputs (may be test,train or ref)")
 
+# Setup default strip tool used by 'lit'
+if(NOT DEFINED CMAKE_STRIP)
+  set (CMAKE_STRIP "strip")
+endif()
+
 # Enable profile generate mode in lit. Note that this does not automatically
 # add something like -fprofile-instr-generate to the compiler flags.
 set(TEST_SUITE_PROFILE_GENERATE "FALSE" CACHE BOOL


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18308.51141.patch
Type: text/x-patch
Size: 1624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160321/08eb8bde/attachment.bin>


More information about the llvm-commits mailing list