summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-06-12 10:20:48 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-06-12 10:24:17 +0000
commit2579391b05758940652a8ac5207d0137720affd1 (patch)
treef6987b9bde94eabdd23c26541ab789d2c135e4ed
parent7f2ccd3d3095a79ad0f3cd0215d062415b20e083 (diff)
downloadmorph-2579391b05758940652a8ac5207d0137720affd1.tar.gz
buildsystem: Comment strip command
Change-Id: Ib8ed113731590b3c9bc3559fb07820bd25c462b8
-rw-r--r--morphlib/buildsystem.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py
index 5c16a9fe..f56dde79 100644
--- a/morphlib/buildsystem.py
+++ b/morphlib/buildsystem.py
@@ -19,6 +19,13 @@ import morphlib
# TODO: Make idempotent when files are hardlinks
+# Strip all ELF binary files that are executable or named like a library.
+# .so files for C, .cmxs for OCaml and .node for Node.
+# The file name and permissions checks are done with the `find` command before
+# the ELF header is checked with the shell command, because it is a lot cheaper
+# to check the mode and file name first, because it is a metadata check, rather
+# than a subprocess and a file read.
+# `file` is not used, to keep the dependency requirements down.
_STRIP_COMMAND = r'''find "$DESTDIR" -type f \
'(' -perm -111 -o -name '*.so*' -o -name '*.cmxs' -o -name '*.node' ')' \
-exec sh -ec \