diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2012-07-31 04:00:01 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-28 16:53:06 +0100 |
commit | 988318927afa9ba098d3a8570aabc706195a22e8 (patch) | |
tree | 464e72c37c680787a067edba8fbd0b0fdca08d3f /meta | |
parent | bf9a5226fce35a74c491ecaf6b56e3eb9ef1f843 (diff) | |
download | poky-988318927afa9ba098d3a8570aabc706195a22e8.tar.gz |
package.bbclass: fix TypeError in runstrip
* some packages have .ko files which are not elf, without this change
it fails with TypeError, with this change only runstip fails and
reports where:
ERROR: runstrip: ''arm-oe-linux-gnueabi-strip' '/OE/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/emacs-23.4-r0/package/usr/share/emacs/23.4/etc/tutorials/TUTORIAL.ko'' strip command failed
(From OE-Core rev: 12e40ca7317289fec126d9f30b28a717fe72d274)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package.bbclass | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 44e551f6dd..c03e5be028 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -298,12 +298,16 @@ def runstrip(file, elftype, d): | |||
298 | os.chmod(file, newmode) | 298 | os.chmod(file, newmode) |
299 | 299 | ||
300 | extraflags = "" | 300 | extraflags = "" |
301 | # .so and shared library | 301 | |
302 | if ".so" in file and elftype & 8: | 302 | # split_and_strip_files is calling this with elf_type None, causing: |
303 | extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded" | 303 | # TypeError: unsupported operand type(s) for &: 'NoneType' and 'int' |
304 | # shared or executable: | 304 | if elftype: |
305 | elif elftype & 8 or elftype & 4: | 305 | # .so and shared library |
306 | extraflags = "--remove-section=.comment --remove-section=.note" | 306 | if ".so" in file and elftype & 8: |
307 | extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded" | ||
308 | # shared or executable: | ||
309 | elif elftype & 8 or elftype & 4: | ||
310 | extraflags = "--remove-section=.comment --remove-section=.note" | ||
307 | 311 | ||
308 | stripcmd = "'%s' %s '%s'" % (strip, extraflags, file) | 312 | stripcmd = "'%s' %s '%s'" % (strip, extraflags, file) |
309 | bb.debug(1, "runstrip: %s" % stripcmd) | 313 | bb.debug(1, "runstrip: %s" % stripcmd) |