Gentoo Archives: gentoo-embedded

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

Replies

Subject Author
Re: [gentoo-embedded] crossdev, alternate root, and build dependencies Christopher Friedt <chrisfriedt@×××××.com>