Skip to contentSkip to conversation

debian.bbclass: call objdump from binutils-cross

PATCH In review Martin Jansa 3 participants 3 messages Jun 8, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debian.bbclass: call objdump from binutils-cross

* host objdump can support multiple targets and instead of output it shows list of targets to choose from see http://thread.gmane.org/gmane.comp.handhelds.openembedded/33294/focus=33357
* for some reason cross/bin doesn't seem to be in PATH, that's why there
is full path

---
 classes/debian.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
classes/debian.bbclass +1 -1
index 8f6e7d8..d41c922 100644
@@ -54,7 +54,7 @@ python debian_package_name_hook () {
 				for f in files:
 					if so_re.match(f):
 						fp = os.path.join(root, f)
-						cmd = (bb.data.getVar('BUILD_PREFIX', d, 1) or "") + "objdump -p " + fp + " 2>/dev/null"
+						cmd = bb.data.getVar('CROSS_DIR', d, 1) + "/" + bb.data.getVar('bindir_cross', d, 1) + "/" + bb.data.getVar('TARGET_PREFIX', d, 1) + "objdump -p " + fp + " 2>/dev/null"
 						fd = os.popen(cmd)
 						lines = fd.readlines()
 						fd.close()
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Martin Jansa

* host objdump can support multiple targets and instead of output it shows list of targets to choose from see http://thread.gmane.org/gmane.comp.handhelds.openembedded/33294/focus=33357
* for some reason cross/bin doesn't seem to be in PATH, that's why there
 is full path

Quoted 26 lines

---
 classes/debian.bbclass |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
classes/debian.bbclass +0 -0
index 8f6e7d8..d41c922 100644
@@ -54,7 +54,7 @@ python debian_package_name_hook () {

                               for f in files:
                                       if so_re.match(f):
                                               fp = os.path.join(root, f)
-                                               cmd = (bb.data.getVar('BUILD_PREFIX', d, 1) or "") + "objdump -p " + fp + " 2>/dev/null"
+                                               cmd = bb.data.getVar('CROSS_DIR', d, 1) + "/" + bb.data.getVar('bindir_cross', d, 1) + "/" + bb.data.getVar('TARGET_PREFIX', d, 1) + "objdump -p " + fp + " 2>/dev/null" fd = os.popen(cmd)
                                               lines = fd.readlines()
                                               fd.close()
--
1.7.1

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#2 lore raw
In reply to Martin Jansa
Quoted 7 lines · Martin Jansa

* host objdump can support multiple targets and instead of output it shows list of targets to choose from
see
http://thread.gmane.org/gmane.comp.handhelds.openembedded/33294/focus=33357
* for some reason cross/bin doesn't seem to be in PATH, that's why there is full path

cross/bin is in the PATH *bitbake* variable, but not in the *environment* exported to subprocesses. I'd suggest either setting PATH in cmd, which we've done in the past, or use the oe_popen/oe_system convenience functions, which pull all exported bitbake vars into the environment used to spawn the subprocess.

Ideally, it wouldn't be necessary -- perhaps we should think about having bitbake's finalize() transfer the vars over into os.environ, or something...

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics