Gentoo Archives: gentoo-user

From: "Dustin C. Hatch" <admiralnemo@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] crossdev, alternate root, and build dependencies
Date: Wed, 12 Dec 2012 17:36:42
Message-Id: 50C8C053.9080408@gmail.com
1 I am trying to understand and use crossdev to build Gentoo for my
2 Raspberry Pi, and I have a couple of questions. I was able to
3 successfully build a toolchain::
4
5 crossdev -S -t armv6j-hardfloat-linux-gnueabi
6
7 This correctly installed binutils, gcc, glibc, and linux-headers::
8
9 equery list cross-armv6j-hardfloat-linux-gnueabi/*
10 * Searching for * in cross-armv6j-hardfloat-linux-gnueabi ...
11 [I-O] [ ] cross-armv6j-hardfloat-linux-gnueabi/binutils-2.22-r1:0
12 [I-O] [ ] cross-armv6j-hardfloat-linux-gnueabi/gcc-4.5.4:4.5
13 [I-O] [ ] cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3:2.2
14 [I-O] [ ] cross-armv6j-hardfloat-linux-gnueabi/linux-headers-3.6:0
15
16 I then copied the configuration from
17 /usr/armv6j-hardfloat-linux-gnueabi/etc/portage to an alternate
18 location, so I could modify it without impacting the crossdev toolchain.
19 Next, I started to emerge some ebuilds into a staging directory using
20 the following commands::
21
22 export CBUILD=$(portageq envvar CHOST)
23 export PORTAGE_CONFIGROOT=/home/dustin/rpi-build/configroot
24 export ROOT=/home/dustin/rpi-build/buildroot/
25 export PORTAGE_TMPDIR=/home/dusitn/rpi-build/tmp
26 emerge --nodeps baselayout
27 emerge --onlydeps baselayout
28
29 The first pass completed successfully, but the second failed to build
30 psmisc::
31
32 checking for tgetent in -ltinfo... no
33 checking for tgetent in -lncurses... no
34 checking for tgetent in -ltermcap... no
35 configure: error: Cannot find tinfo, ncurses or termcap libraries
36
37 config.log shows this::
38
39 configure:3970: checking for tgetent in -lncurses
40 configure:3995: armv6j-hardfloat-linux-gnueabi-gcc -o conftest -O4
41 -pipe -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
42 -fomit-frame-pointer conftest.c -lncurses >&5
43 /usr/libexec/gcc/armv6j-hardfloat-linux-gnueabi/ld: cannot find
44 -lncurses
45 collect2: ld returned 1 exit status
46 configure:3995: $? = 1
47
48 ncurses did get installed in the alternate root::
49
50 ls -1 ${ROOT}lib/libncurses*
51 /home/dustin/rpi-build/buildroot/lib/libncurses.so.5
52 /home/dustin/rpi-build/buildroot/lib/libncurses.so.5.9
53 /home/dustin/rpi-build/buildroot/lib/libncursesw.so.5
54 /home/dustin/rpi-build/buildroot/lib/libncursesw.so.5.9
55
56 Now, I've found that if I install ncurses in /usr/${CHOST} instead of
57 ${ROOT}, psmisc will build successfully. I am thus confused on where
58 things are supposed to be built. The Cross Development Guide says not to
59 install pieces of the toolchain in /usr/${CHOST}, but some ebuilds, like
60 openrc, have explicit RDEPENDs on them, so emerge pulls them in. I'm not
61 sure how to resolve this seeming catch-22 where I can't install runtime
62 dependencies in /usr/${CHOST}, but I also can't install build
63 dependencies in in ${ROOT}.
64
65 I am hoping to have this process scriptable, so my current method of
66 just installing missing build dependencies in /usr/${CHOST} after
67 something fails won't work. Any pointers would be appreciated.
68
69 Thanks,
70
71 --
72 ♫Dustin