diff options
Diffstat (limited to 'meta/lib/oe/package.py')
-rw-r--r-- | meta/lib/oe/package.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 02642f29f0..ae60a5843e 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py | |||
@@ -18,23 +18,24 @@ def runstrip(arg): | |||
18 | newmode = origmode | stat.S_IWRITE | stat.S_IREAD | 18 | newmode = origmode | stat.S_IWRITE | stat.S_IREAD |
19 | os.chmod(file, newmode) | 19 | os.chmod(file, newmode) |
20 | 20 | ||
21 | extraflags = "" | 21 | stripcmd = [strip] |
22 | 22 | ||
23 | # kernel module | 23 | # kernel module |
24 | if elftype & 16: | 24 | if elftype & 16: |
25 | extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates" | 25 | stripcmd.extend(["--strip-debug", "--remove-section=.comment", |
26 | "--remove-section=.note", "--preserve-dates"]) | ||
26 | # .so and shared library | 27 | # .so and shared library |
27 | elif ".so" in file and elftype & 8: | 28 | elif ".so" in file and elftype & 8: |
28 | extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded" | 29 | stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"]) |
29 | # shared or executable: | 30 | # shared or executable: |
30 | elif elftype & 8 or elftype & 4: | 31 | elif elftype & 8 or elftype & 4: |
31 | extraflags = "--remove-section=.comment --remove-section=.note" | 32 | stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"]) |
32 | 33 | ||
33 | stripcmd = "'%s' %s '%s'" % (strip, extraflags, file) | 34 | stripcmd.append(file) |
34 | bb.debug(1, "runstrip: %s" % stripcmd) | 35 | bb.debug(1, "runstrip: %s" % stripcmd) |
35 | 36 | ||
36 | try: | 37 | try: |
37 | output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True) | 38 | output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT) |
38 | except subprocess.CalledProcessError as e: | 39 | except subprocess.CalledProcessError as e: |
39 | bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output)) | 40 | bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output)) |
40 | 41 | ||