Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: "Eric Bénard" <eric@eukrea.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: dylan: meta-toolchain and u-boot : "cannot find -lgcc"
Date: Fri, 26 Apr 2013 09:46:20 -0500	[thread overview]
Message-ID: <517A933C.4020507@windriver.com> (raw)
In-Reply-To: <20130426164157.42a0226b@e6520eb>

On 4/26/13 9:41 AM, Eric Bénard wrote:
> Hi Mark,
>
> Le Fri, 26 Apr 2013 08:51:58 -0500,
> Mark Hatle <mark.hatle@windriver.com> a écrit :
>> On 4/26/13 2:26 AM, Eric Bénard wrote:
>>> this can be fixed by installing the sdk to it's standard path
>>> (/usr/local/oecore-x86_64/ in the present case).
>>>
>>> Is that an expected behaviour (as the sdk is primarly designed to build
>>> applications) or can that be fixed during the sdk relocation ?
>>
>> When you use the SDK, you need to be sure to source the SDK environment setup.
>> Once you do that, pass to the compiler/linker the included CFLAGS and LDFLAGS as
>> specified in that environment file.
>
> of course I did source it (and forget to put it in the email as that
> was obvious to me, sorry).
>
>> They should end up passing at some point a --sysroot=... and that will tell gcc
>> where the libraries and headers are for linking.  Without the --sysroot= option,
>> the compiler has no choice but to look for it's original compilation directory.
>>
> true, that's why I provided the step to reproduce and said "as the
> sdk is primarly designed to build applications" and that's certainly
> why we get this problem : for linux & u-boot we can't use the LDFLAGS
> as set by the environment script else we get :
>
> for u-boot :
> arm-oe-linux-gnueabi-ld.bfd: unrecognized option '-Wl,-O1'
> so we need to pass LDFLAGS="" which then leads to :
> arm-oe-linux-gnueabi-ld.bfd: cannot find -lgcc
> if and only if the sdk was relocated.
> (and I also get the error even if I add LDFLAGS="
> --sysroot=/path_to/oecore-x86_64/sysroots/armv5te-oe-linux-gnueabi"
> so this seems specific to -lgcc)
>
> for linux :
> arm-oe-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
> so here again we need to pass LDFLAGS="" which leads to a successful
> build as the build is not using lgcc.

I see, it's using ld instead of gcc for linking.  AFAIK though, you really 
shouldn't be using -lgcc in either uboot or linux for any platform.  That seems 
suspicious to me.

It's reasonable to file a bug in the Yocto Project bugzilla, but I'm not sure 
what kind of resolution we'll get.

--Mark

> Eric
>




  reply	other threads:[~2013-04-26 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26  7:26 dylan: meta-toolchain and u-boot : "cannot find -lgcc" Eric Bénard
2013-04-26 13:51 ` Mark Hatle
2013-04-26 14:41   ` Eric Bénard
2013-04-26 14:46     ` Mark Hatle [this message]
2013-04-26 15:11       ` Eric Bénard

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=517A933C.4020507@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=eric@eukrea.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