]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: Ensure all .so files get stripped
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Mar 2013 13:10:22 +0000 (13:10 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Mar 2013 13:14:11 +0000 (13:14 +0000)
It was realised that .so files which were not marked as executable were not
gettings stripped. This was wasting space in images. This patch ensures
they do get processed by the code correctly.

[YOCTO #3973]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass

index d37499f291b3301cae493fec1aec9d3f0fc61fa9..1625ebdb38b1ec69665b00cadd3fc1b9c115e1c1 100644 (file)
@@ -725,6 +725,8 @@ python split_and_strip_files () {
     symlinks = {}
     hardlinks = {}
     kernmods = []
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
     if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1') and \
             (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1'):
         for root, dirs, files in os.walk(dvar):
@@ -749,7 +751,8 @@ python split_and_strip_files () {
                     # Skip broken symlinks
                     continue
                 # Check its an excutable
-                if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH):
+                if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \
+                        or ((file.startswith(libdir) or file.startswith(baselibdir)) and ".so" in f):
                     # If it's a symlink, and points to an ELF file, we capture the readlink target
                     if os.path.islink(file):
                         target = os.readlink(file)