I am trying to understand and use crossdev to build Gentoo for my Raspberry Pi, and I have a couple of questions. I was able to successfully build a toolchain::

    crossdev -S -t armv6j-hardfloat-linux-gnueabi

This correctly installed binutils, gcc, glibc, and linux-headers::

    equery list cross-armv6j-hardfloat-linux-gnueabi/*
     * Searching for * in cross-armv6j-hardfloat-linux-gnueabi ...
    [I-O] [  ] cross-armv6j-hardfloat-linux-gnueabi/binutils-2.22-r1:0
    [I-O] [  ] cross-armv6j-hardfloat-linux-gnueabi/gcc-4.5.4:4.5
    [I-O] [  ] cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3:2.2
    [I-O] [  ] cross-armv6j-hardfloat-linux-gnueabi/linux-headers-3.6:0

I then copied the configuration from /usr/armv6j-hardfloat-linux-gnueabi/etc/portage to an alternate location, so I could modify it without impacting the crossdev toolchain. Next, I started to emerge some ebuilds into a staging directory using the following commands::

    export CBUILD=$(portageq envvar CHOST)
    export PORTAGE_CONFIGROOT=/home/dustin/rpi-build/configroot
    export ROOT=/home/dustin/rpi-build/buildroot/
    export PORTAGE_TMPDIR=/home/dusitn/rpi-build/tmp
    emerge --nodeps baselayout
    emerge --onlydeps baselayout

The first pass completed successfully, but the second failed to build psmisc::

    checking for tgetent in -ltinfo... no
    checking for tgetent in -lncurses... no
    checking for tgetent in -ltermcap... no
    configure: error: Cannot find tinfo, ncurses or termcap libraries

config.log shows this::

    configure:3970: checking for tgetent in -lncurses
    configure:3995: armv6j-hardfloat-linux-gnueabi-gcc -o conftest -O4
    -pipe -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
    -fomit-frame-pointer   conftest.c -lncurses   >&5
    /usr/libexec/gcc/armv6j-hardfloat-linux-gnueabi/ld: cannot find
    -lncurses
    collect2: ld returned 1 exit status
    configure:3995: $? = 1

ncurses did get installed in the alternate root::

    ls -1 ${ROOT}lib/libncurses*
    /home/dustin/rpi-build/buildroot/lib/libncurses.so.5
    /home/dustin/rpi-build/buildroot/lib/libncurses.so.5.9
    /home/dustin/rpi-build/buildroot/lib/libncursesw.so.5
    /home/dustin/rpi-build/buildroot/lib/libncursesw.so.5.9

Now, I've found that if I install ncurses in /usr/${CHOST} instead of ${ROOT}, psmisc will build successfully. I am thus confused on where things are supposed to be built. The Cross Development Guide says not to install pieces of the toolchain in /usr/${CHOST}, but some ebuilds, like openrc, have explicit RDEPENDs on them, so emerge pulls them in. I'm not sure how to resolve this seeming catch-22 where I can't install runtime dependencies in /usr/${CHOST}, but I also can't install build dependencies in in ${ROOT}.

I am hoping to have this process scriptable, so my current method of just installing missing build dependencies in /usr/${CHOST} after something fails won't work. Any pointers would be appreciated.

Thanks,

--
♫Dustin

Reply via email to