[oe] External toolchain - Helloworld works but help needed

Marco Guerri gmarco.dev at gmail.com
Thu Oct 4 14:16:44 UTC 2012


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



More information about the Openembedded-devel mailing list