From 988318927afa9ba098d3a8570aabc706195a22e8 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Tue, 31 Jul 2012 04:00:01 +0200 Subject: 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 Signed-off-by: Richard Purdie --- meta/classes/package.bbclass | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'meta/classes') 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): os.chmod(file, newmode) extraflags = "" - # .so and shared library - if ".so" in file and elftype & 8: - extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded" - # shared or executable: - elif elftype & 8 or elftype & 4: - extraflags = "--remove-section=.comment --remove-section=.note" + + # split_and_strip_files is calling this with elf_type None, causing: + # TypeError: unsupported operand type(s) for &: 'NoneType' and 'int' + if elftype: + # .so and shared library + if ".so" in file and elftype & 8: + extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded" + # shared or executable: + elif elftype & 8 or elftype & 4: + extraflags = "--remove-section=.comment --remove-section=.note" stripcmd = "'%s' %s '%s'" % (strip, extraflags, file) bb.debug(1, "runstrip: %s" % stripcmd) -- cgit v1.2.3-54-g00ecf