Gentoo Archives: gentoo-embedded

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

Replies

Subject Author
Re: [gentoo-embedded] crossdev, alternate root, and build dependencies Joakim Tjernlund <joakim.tjernlund@×××××××××.se>