Bug 3009

Summary: qemu emulator from the toolchain installed by ADT installer failed to execute binary file
Product: [Yocto Project Subprojects] ADT Reporter: liang li <liang.li2>
Component: adtAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: columba.livia, jessica.zhang, jiajun.xu, laurentiu.serban, poky.adt.watcher, poky.watcher, sgw, yi.zhao
Version: 1.3   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description liang li 2012-08-24 09:58:18 UTC
run "adt_installer" to build toolchain,error met when follow these step:
1.source 1.2+snapshot/environment-setup-armv5te-poky-linux-gnueabi
2.qemu-arm (qemu-ppc,qemu-mips,qemu-x86,qemu-x86_64)
bash: /opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-arm: cannot execute binary file
Comment 1 liang li 2012-08-24 10:05:03 UTC
the adt-installer is from :
http://autobuilder.pokylinux.org/nightly/20120822-1/adt_installer/adt_installer.tar.bz2
git info:19ff55a53b436d463f9577adaed15be77708f0d2
git branch:poky/master
Comment 2 Yi Zhao 2012-09-07 10:56:43 UTC
With 1.3 beta 20120905 build, this issue still happens.
adt_intaller from http://downloads.yoctoproject.org/releases/yocto/milestones/yocto-1.3-beta/adt_installer-QA/

Steps:
1. download adt_installer.tar.bz2 from http://downloads.yoctoproject.org/releases/yocto/milestones/yocto-1.3-beta/adt_installer-QA/
2. Install adt_installer: $ ./adt_installer
3. source /opt/poky/1.2+snapshot/environment-setup-armv5te-poky-linux-gnueabi
4. run "qemu-arm"

Error message:
###############
$ which qemu-arm 
/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-arm
$ qemu-arm
bash: /opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-arm: cannot execute binary file
################

There is no this issue when install from meta-toolchain tarball:
#############
$ sudo sh poky-eglibc-x86_64-arm-toolchain-gmae-1.2+snapshot-20120905.sh
$ source /opt/poky/1.2+snapshot/environment-setup-armv5te-poky-linux-gnueabi
$ which qemu-arm
/opt/poky/1.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-arm
$ qemu-arm 
qemu-arm version 0.15.1, Copyright (c) 2003-2008 Fabrice Bellard
usage: qemu-arm [options] program [arguments...]
Linux CPU emulator (compiled for arm emulation)

Standard options:
-h                print this help
-version          display version information and exit
-g port           wait gdb connection to port
-L path           set the elf interpreter prefix (default=/usr/gnemul/qemu-arm)
-s size           set the stack size in bytes (default=8388608)
-cpu model        select CPU (-cpu ? for list)
-drop-ld-preload  drop LD_PRELOAD for target process
-E var=value      sets/modifies targets environment variable(s)
-U var            unsets targets environment variable(s)
-0 argv0          forces target process argv[0] to be argv0
-B address        set guest_base address to address
-R size           reserve size bytes for guest virtual address space

Debug options:
-d options   activate log (logfile=/tmp/qemu.log)
-p pagesize  set the host page size to 'pagesize'
-singlestep  always run in singlestep mode
-strace      log system calls

Environment variables:
QEMU_STRACE       Print system calls and arguments similar to the
                  'strace' program.  Enable by setting to any value.
You can use -E and -U options to set/unset environment variables
for target process.  It is possible to provide several variables
by repeating the option.  For example:
    -E var1=val2 -E var2=val2 -U LD_PRELOAD -U LD_DEBUG
Note that if you provide several changes to single variable
last change will stay in effect.
##############
Comment 3 Laurentiu Palcu 2012-09-07 18:13:37 UTC
The adtrepo.yoctoproject.org and adtrepo-dev.yoctoproject.org do not contain the latest packages. So, they cannot be used. Until this is fixed, use a local repo. It will work.
Comment 4 liang li 2012-09-13 07:40:29 UTC
the error still met in 1.3 M4 RC2 from below:
http://autobuilder.yoctoproject.org/pub/nightly/20120910-5/adt_installer-QA/adt_installer.tar.bz2
Comment 5 Jessica 2012-09-13 21:30:20 UTC
Beth and I took a look at this issue today, and we sure do still failing against M4 RC2 repo and it's fine against latest master, seems this commit fix the issue (http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c8e3e0149a23ee7f1477a73821d09e68883d988a) so we probably need to respin M4 build for RC3
Comment 6 liang li 2012-09-18 10:33:19 UTC
no such error in 1.3 M4 RC3 from below:
http://autobuilder.yoctoproject.org/pub/nightly/20120916-2/adt_installer-QA/adt_installer.tar.bz2

git info:e5c3513ca8abb21eb5e9b8c19d1b9199b14ae07c
git branch:poky/1.3_M4
Comment 7 Laurentiu Palcu 2012-09-18 11:54:46 UTC
This was also related to bug #3083 which was fixed by the following patch:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c8e3e0149a23ee7f1477a73821d09e68883d988a

Together with the adtrepo changes, this issue does not happen anymore. Closing.
Comment 8 Jessica 2012-09-18 17:29:34 UTC
please refer to last comments for the commit
Comment 9 liang li 2012-09-19 03:05:19 UTC
verified on :
git info:e5c3513ca8abb21eb5e9b8c19d1b9199b14ae07c
git branch:poky/1.3_M4