All of lore.kernel.org
 help / color / mirror / Atom feed
* External toolchain - Helloworld works but help needed
@ 2012-10-04 14:16 Marco Guerri
  2012-10-04 16:24 ` McClintock Matthew-B29882
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marco Guerri @ 2012-10-04 14:16 UTC (permalink / raw)
  To: openembedded-devel; +Cc: guerri.ma

Hi everybody,

I'm having some troubles trying to get a working filesystem for a custom
board based on a Freescale iMX35 SOC.
I'm trying to integrate an external working toolchain+glibc (freescale)
with OpenEmbedded. My problem is
that I do not have a complete understanding of the whole toolchain
management process done by OE. I anticipate
that I can compile a working helloworld image which runs correctly on the
hardware only if it is statically
linked aginst the libc. With dynamic linking it does not work (in the case
of helloworld: Kernel panic no
init found) I think the problem is that I cannot find a way to deploy the
libc into the filesystem (if I mount the fs
image on my host of course there's nothing except a dynamically linked
helloworld binary...).

My local.conf reports these TOOLCHAIN related options:

TOOLCHAIN_VENDOR = "-none"
TOOLCHAIN_TYPE = "external"
TOOLCHAIN_BRAND = "mtoolch"
TOOLCHAIN_PATH = "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3"
TOOLCHAIN_SYSPATH =
"/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi"

As far as I've understood, the important recipe in this case should be
external-toolchain-mtoolch.bb. In particular:

    - do_stage() should copy all the important libraries (libc) in the
staging area in order to be able to
    link correctly during the build process.

    - do_install() should copy all the important libraries in the install
area so that they can be
    packaged and deployed in the filesystem.

I'm stuck at the second point. Right now I manually carry out the first
point (that is, I copy
the libc and all the libraries in the staging area). I'm sure that this
process works because all the binaries
are correctly linked against the libc (even the tiny helloworld program
which works on the hardware).
I've tried to write a do_install method but I think I'm misunderstaing
something: the do_install
method is basically the following

do_install() {

        install -d ${D}${libdir}
        install -d ${D}${base_libdir}
        install -d ${D}${includedir}

        cp -a
${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/lib/*
${D}${base_libdir}
        cp -a
${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/usr/lib/*
${D}${libdir}
        cp -a
${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/include/*
${D}${includedir}
}

The result is that everything is copied into
build/work/i686-armv6-sdk-none-linux-gnueabi/external-toolchain-mtoolch-1.0-r3
and not in build/work/armv6-none-linux-gnueabi, where all the stuff that is
later deployed in the filesystem is copied. So
I do not have a clear understaing of what is going on and if I'm using
external-toolchain-mtoolch.bb properly or not.

Any suggestion is appreciated, I've ran out of ideas but I do not want to
give up at this point.
Thank you very much.

Marco


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: External toolchain - Helloworld works but help needed
  2012-10-04 14:16 External toolchain - Helloworld works but help needed Marco Guerri
@ 2012-10-04 16:24 ` McClintock Matthew-B29882
  2012-10-04 17:00 ` Khem Raj
  2012-10-05  8:51 ` Eric Bénard
  2 siblings, 0 replies; 5+ messages in thread
From: McClintock Matthew-B29882 @ 2012-10-04 16:24 UTC (permalink / raw)
  To: openembedded-devel@lists.openembedded.org; +Cc: guerri.ma@gmail.com

On Thu, Oct 4, 2012 at 9:16 AM, Marco Guerri <gmarco.dev@gmail.com> wrote:
> Hi everybody,
>
> I'm having some troubles trying to get a working filesystem for a custom
> board based on a Freescale iMX35 SOC.
> I'm trying to integrate an external working toolchain+glibc (freescale)
> with OpenEmbedded. My problem is
> that I do not have a complete understanding of the whole toolchain
> management process done by OE. I anticipate
> that I can compile a working helloworld image which runs correctly on the
> hardware only if it is statically
> linked aginst the libc. With dynamic linking it does not work (in the case
> of helloworld: Kernel panic no
> init found) I think the problem is that I cannot find a way to deploy the
> libc into the filesystem (if I mount the fs
> image on my host of course there's nothing except a dynamically linked
> helloworld binary...).
>
> My local.conf reports these TOOLCHAIN related options:
>
> TOOLCHAIN_VENDOR = "-none"
> TOOLCHAIN_TYPE = "external"
> TOOLCHAIN_BRAND = "mtoolch"
> TOOLCHAIN_PATH = "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3"
> TOOLCHAIN_SYSPATH =
> "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi"
>
> As far as I've understood, the important recipe in this case should be
> external-toolchain-mtoolch.bb. In particular:
>
>     - do_stage() should copy all the important libraries (libc) in the
> staging area in order to be able to
>     link correctly during the build process.

What OE are you using? do_stage seems to be depreciated.

-M

>
>     - do_install() should copy all the important libraries in the install
> area so that they can be
>     packaged and deployed in the filesystem.
>
> I'm stuck at the second point. Right now I manually carry out the first
> point (that is, I copy
> the libc and all the libraries in the staging area). I'm sure that this
> process works because all the binaries
> are correctly linked against the libc (even the tiny helloworld program
> which works on the hardware).
> I've tried to write a do_install method but I think I'm misunderstaing
> something: the do_install
> method is basically the following
>
> do_install() {
>
>         install -d ${D}${libdir}
>         install -d ${D}${base_libdir}
>         install -d ${D}${includedir}
>
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/lib/*
> ${D}${base_libdir}
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/usr/lib/*
> ${D}${libdir}
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/include/*
> ${D}${includedir}
> }
>
> The result is that everything is copied into
> build/work/i686-armv6-sdk-none-linux-gnueabi/external-toolchain-mtoolch-1.0-r3
> and not in build/work/armv6-none-linux-gnueabi, where all the stuff that is
> later deployed in the filesystem is copied. So
> I do not have a clear understaing of what is going on and if I'm using
> external-toolchain-mtoolch.bb properly or not.
>
> Any suggestion is appreciated, I've ran out of ideas but I do not want to
> give up at this point.
> Thank you very much.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: External toolchain - Helloworld works but help needed
  2012-10-04 14:16 External toolchain - Helloworld works but help needed Marco Guerri
  2012-10-04 16:24 ` McClintock Matthew-B29882
@ 2012-10-04 17:00 ` Khem Raj
  2012-10-05  8:51 ` Eric Bénard
  2 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2012-10-04 17:00 UTC (permalink / raw)
  To: openembedded-devel; +Cc: guerri.ma

On Thu, Oct 4, 2012 at 7:16 AM, Marco Guerri <gmarco.dev@gmail.com> wrote:
> Hi everybody,
>
> I'm having some troubles trying to get a working filesystem for a custom
> board based on a Freescale iMX35 SOC.
> I'm trying to integrate an external working toolchain+glibc (freescale)
> with OpenEmbedded. My problem is
> that I do not have a complete understanding of the whole toolchain
> management process done by OE. I anticipate
> that I can compile a working helloworld image which runs correctly on the
> hardware only if it is statically
> linked aginst the libc. With dynamic linking it does not work (in the case
> of helloworld: Kernel panic no
> init found) I think the problem is that I cannot find a way to deploy the
> libc into the filesystem (if I mount the fs
> image on my host of course there's nothing except a dynamically linked
> helloworld binary...).
>
> My local.conf reports these TOOLCHAIN related options:
>
> TOOLCHAIN_VENDOR = "-none"
> TOOLCHAIN_TYPE = "external"
> TOOLCHAIN_BRAND = "mtoolch"
> TOOLCHAIN_PATH = "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3"
> TOOLCHAIN_SYSPATH =
> "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi"
>
> As far as I've understood, the important recipe in this case should be
> external-toolchain-mtoolch.bb. In particular:
>
>     - do_stage() should copy all the important libraries (libc) in the
> staging area in order to be able to
>     link correctly during the build process.
>
>     - do_install() should copy all the important libraries in the install
> area so that they can be
>     packaged and deployed in the filesystem.
>
> I'm stuck at the second point. Right now I manually carry out the first
> point (that is, I copy
> the libc and all the libraries in the staging area). I'm sure that this
> process works because all the binaries
> are correctly linked against the libc (even the tiny helloworld program
> which works on the hardware).
> I've tried to write a do_install method but I think I'm misunderstaing
> something: the do_install
> method is basically the following
>
> do_install() {
>
>         install -d ${D}${libdir}
>         install -d ${D}${base_libdir}
>         install -d ${D}${includedir}
>
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/lib/*
> ${D}${base_libdir}
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/usr/lib/*
> ${D}${libdir}
>         cp -a
> ${TOOLCHAIN_PATH}/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/include/*
> ${D}${includedir}
> }
>
> The result is that everything is copied into
> build/work/i686-armv6-sdk-none-linux-gnueabi/external-toolchain-mtoolch-1.0-r3
> and not in build/work/armv6-none-linux-gnueabi, where all the stuff that is
> later deployed in the filesystem is copied. So
> I do not have a clear understaing of what is going on and if I'm using
> external-toolchain-mtoolch.bb properly or not.
>
> Any suggestion is appreciated, I've ran out of ideas but I do not want to
> give up at this point.
> Thank you very much.
>


I would suggest to start with external-sourcery-toolchain.bb recipe in OE-Core
and then model a recipe for your toolchain based on that. Although be
warned that
gcc 4.1 might be inadequate for the recipes we have currently so you might
run into more bumps.

> Marco
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: External toolchain - Helloworld works but help needed
  2012-10-04 14:16 External toolchain - Helloworld works but help needed Marco Guerri
  2012-10-04 16:24 ` McClintock Matthew-B29882
  2012-10-04 17:00 ` Khem Raj
@ 2012-10-05  8:51 ` Eric Bénard
  2012-10-08  6:31   ` Marco Guerri
  2 siblings, 1 reply; 5+ messages in thread
From: Eric Bénard @ 2012-10-05  8:51 UTC (permalink / raw)
  To: Marco Guerri; +Cc: openembedded-devel

Hi Marco,

Le Thu, 4 Oct 2012 16:16:44 +0200,
Marco Guerri <gmarco.dev@gmail.com> a écrit :
> I'm having some troubles trying to get a working filesystem for a custom
> board based on a Freescale iMX35 SOC.

you can find our working BSP for an i.MX35 board here :
https://github.com/eukrea/meta-eukrea
(use MACHINE="eukrea-cpuimx35")

Best regards
Eric



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: External toolchain - Helloworld works but help needed
  2012-10-05  8:51 ` Eric Bénard
@ 2012-10-08  6:31   ` Marco Guerri
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Guerri @ 2012-10-08  6:31 UTC (permalink / raw)
  To: Eric Bénard; +Cc: openembedded-devel

Thank you to everyone, I've solved my problem following the example of 
external-sourcery-toolchain.bb. Now all the libraries are deployed 
correctly into the filesystem and I can boot a minimal-image. Right now 
I'm using oe classic but I will switch to oe-core asap.

Best regards
Marco

Il 10/05/2012 10:51 AM, Eric Bénard ha scritto:
> Hi Marco,
>
> Le Thu, 4 Oct 2012 16:16:44 +0200,
> Marco Guerri <gmarco.dev@gmail.com> a écrit :
>> I'm having some troubles trying to get a working filesystem for a custom
>> board based on a Freescale iMX35 SOC.
> you can find our working BSP for an i.MX35 board here :
> https://github.com/eukrea/meta-eukrea
> (use MACHINE="eukrea-cpuimx35")
>
> Best regards
> Eric




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-08  6:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 14:16 External toolchain - Helloworld works but help needed Marco Guerri
2012-10-04 16:24 ` McClintock Matthew-B29882
2012-10-04 17:00 ` Khem Raj
2012-10-05  8:51 ` Eric Bénard
2012-10-08  6:31   ` Marco Guerri

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.