From 2579391b05758940652a8ac5207d0137720affd1 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 12 Jun 2015 10:20:48 +0000 Subject: buildsystem: Comment strip command Change-Id: Ib8ed113731590b3c9bc3559fb07820bd25c462b8 --- morphlib/buildsystem.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'morphlib/buildsystem.py') 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 \ -- cgit v1.2.1