All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denis@denix.org>
To: "Björn Krombholz" <pirobk@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: meta-toolchain doesn't compile working binaries
Date: Tue, 06 May 2014 16:55:18 -0400	[thread overview]
Message-ID: <20140506205518.GE11339@denix.org> (raw)
In-Reply-To: <536899F5.1030104@gmail.com>

On Tue, May 06, 2014 at 10:14:45AM +0200, Björn Krombholz wrote:
> Hi,
> 
> I'm having trouble building a working toolchain (meta-toolchain) on 
> yocto-1.4 release.
> 
> Buildsystem is x86_64, on current Debian Sid.
> 
> The problem seems to be with ld-linux[...].so, SDKMACHINE doesn't seem to 
> matter (x86_64 and i686 produce broken binaries).
> 
> The effect is, that (almost) every binary in the toolchain segfaults when 
> being run.
> 
> 
> Example m4:
> (in /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux)
> 
> Host ld:
> $ usr/bin/m4 --help
> Segmentation fault
> 
> Explicitly using the toolchain ld:
> $ lib/ld-linux-x86-64.so.2 usr/bin/m4 --help
> Usage: usr/bin/m4 [OPTION]... [FILE]...
> [...]
> 
> 
> Comparing the build with a toolchain created on Jul 30th 2013 (which works 
> fine) I see one major difference:
> 
> Old (working) toolchain:
> $ ldd m4
>         linux-vdso.so.1 (0x00007fffdae00000)
>         libc.so.6 => /usr/local/oecore-x86_64.old_201307/sysroots/x86_64-angstromsdk-linux/usr/bin/./../../lib/libc.so.6 (0x00007f6a71ed0000)
>         /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f6a72280000)
> 
> 
> New (broken) toolchain:
> $ ldd m4
>         linux-vdso.so.1 (0x00007fff36e00000)
>         libc.so.6 => /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/./../../lib/libc.so.6 (0x00007f00e7860000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f00e7c10000)
> 
> 
> The internal toolchain (from tmp/build/) is working fine, though the ldd output looks similar to the broken built one:
> 
> [...]build/tmp-angstrom_v2013_06-eglibc/sysroots/x86_64-linux/usr/bin$ ldd m4 
>         linux-vdso.so.1 (0x00007fff9fdc8000)                                                                                                                                                                                                                                   
>         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f481cda8000)                                                                                                                                                                                                      
>         /lib64/ld-linux-x86-64.so.2 (0x00007f481d188000)
> 
> ATM, on Debian Sid /lib64/ld-linux-x86-64.so.2 is just a link 
> /lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.18.so
> 
> I'd appreciate if someone could give me a hint on this matter, or a point me 
> in a direction, where the problem might be. As mentioned I already tried 
> changing the SDKMACHINE and a completely clean build folder with no effect.

Do you know that OE toolchain is not relocatable? The above symptoms are very 
similar to when you try to execute toolchain binaries from a different 
location that the toolchain was built for or installed to. There is a script 
called relocate_sdk.py that adjusts binaries and libraries to work in the 
required location - it's called during install of the SDK. See pages 24-27 of 
my last year ELC presentation about more details on how OE SDK works:

http://elinux.org/images/c/c8/ExternalToolchainsInYocto.pdf

-- 
Denys


  parent reply	other threads:[~2014-05-06 20:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  8:14 meta-toolchain doesn't compile working binaries Björn Krombholz
2014-05-06 17:01 ` Khem Raj
2014-05-06 20:55 ` Denys Dmytriyenko [this message]
2014-05-06 20:56   ` Khem Raj
2014-05-06 20:59     ` Denys Dmytriyenko
2014-05-06 21:25     ` Mark Hatle
2014-05-06 21:40       ` Khem Raj
2014-05-06 21:44         ` Mark Hatle
2014-05-06 21:49           ` Denys Dmytriyenko
2014-05-07 12:54           ` Björn Krombholz
2014-05-07 14:37             ` Mark Hatle
2014-05-07 14:58             ` Björn Krombholz
2014-05-07 17:13               ` Björn Krombholz
2014-05-06 21:44       ` Denys Dmytriyenko
2014-05-06 21:49         ` Mark Hatle
2014-05-06 21:59           ` Denys Dmytriyenko
2014-05-07 15:27             ` 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=20140506205518.GE11339@denix.org \
    --to=denis@denix.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pirobk@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.