summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-10-07 19:46:35 -0700
committerRobert Yang <liezhi.yang@windriver.com>2015-10-08 05:58:40 -0700
commita7b8d1c512cc8b2cb98864f2fc124cb3336d809d (patch)
treeef5f5d574a7f3d947c966ff4d0713fa6113e7f40
parente7cb89598db33b53478804a0b08b1c6686e0a964 (diff)
downloadopenembedded-core-contrib-a7b8d1c512cc8b2cb98864f2fc124cb3336d809d.tar.gz
openembedded-core-contrib-a7b8d1c512cc8b2cb98864f2fc124cb3336d809d.tar.bz2
openembedded-core-contrib-a7b8d1c512cc8b2cb98864f2fc124cb3336d809d.zip
package.bbclass: strip archive files
For saving space and removing build path in .a files. [YOCTO #8457] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/package.bbclass18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 09230b5bb9..583848f5a7 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -870,12 +870,25 @@ python split_and_strip_files () {
return type
+ def isArchive(path):
+ ret, result = oe.utils.getstatusoutput("file \"%s\"" % path.replace("\"", "\\\""))
+ if ret:
+ msg = "split_and_strip_files: 'file %s' failed" % path
+ package_qa_handle_error("split-strip", msg, d)
+ return False
+
+ if "current ar archive" in result:
+ return True
+ else:
+ return False
+
#
# First lets figure out all of the files we may have to process ... do this only once!
#
elffiles = {}
symlinks = {}
kernmods = []
+ archives = []
inodes = {}
libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
@@ -886,6 +899,9 @@ python split_and_strip_files () {
if file.endswith(".ko") and file.find("/lib/modules/") != -1:
kernmods.append(file)
continue
+ if file.endswith('.a') and isArchive(file):
+ archives.append(file)
+ continue
# Skip debug files
if debugappend and file.endswith(debugappend):
@@ -1019,7 +1035,7 @@ python split_and_strip_files () {
elf_file = int(elffiles[file])
#bb.note("Strip %s" % file)
sfiles.append((file, elf_file, strip))
- for f in kernmods:
+ for f in kernmods + archives:
sfiles.append((f, 16, strip))
oe.utils.multiprocess_exec(sfiles, oe.package.runstrip)