Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] package.bbclass: fix TypeError in runstrip
Date: Tue, 31 Jul 2012 04:00:01 +0200	[thread overview]
Message-ID: <1343700001-15097-1-git-send-email-Martin.Jansa@gmail.com> (raw)

* 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

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 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 6142911..3aaf999 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -291,12 +291,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)
-- 
1.7.8.6




             reply	other threads:[~2012-07-31  2:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  2:00 Martin Jansa [this message]
2012-07-31 11:06 ` [PATCH] package.bbclass: fix TypeError in runstrip Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343700001-15097-1-git-send-email-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox