Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Difference between multilib & no-multilib stages
Date: Sat, 22 Apr 2006 15:03:29
Message-Id: pan.2006.04.22.15.01.03.10039@cox.net
In Reply to: Re: [gentoo-amd64] Re: Re: Difference between multilib & no-multilib stages by Samir Mishra
1 Samir Mishra posted <444A1E13.5000909@×××.ae>, excerpted below, on Sat,
2 22 Apr 2006 16:14:11 +0400:
3
4 > I guess my assuming that I can change the bit-ness of the compilation
5 > via the CHOST variable is a misunderstanding on my part.
6
7 I have a poor understanding of CHOST and the related variables (CBUILD,
8 CTARGET), and I just tried googling for them but got lost in hundreds of
9 pages mentioning Gentoo bugs and the like, without finding a simple one to
10 explain what the variables actually /do/. None-the-less, I believe they
11 are used when cross-compiling for an unrelated arch -- say for ppc from
12 amd64 or whatever. Otherwise, they are best left all in agreement with
13 each other and in general left alone. Other than that and the obvious
14 fact that they include userland and kernel info as well as arch (userland
15 gnu not bsd or some such, kernel linux, not bsd...), I know little about
16 them. I expect if I were to get into serious cross-compiling, I'd find
17 out pretty quick, however.
18
19 > If my primary Gentoo install is using the multilib libraries, can I just
20 > move application packages from a 32-bit chroot to the former and
21 > expect things to work? I've set up glibc with nptl-only. I was planning
22 > to set up a pure 32-bit and pure 64-bit chroot environments. The latter
23 > would have served as a development setup, allowing me to complete all
24 > compiles and move the working applications from the 64-bit chroot to the
25 > main Gentoo instance.
26
27 You actually shouldn't even need to move them, unless you want to. Note
28 that while a chroot can't easily see outside into the host system, the
29 host system can always access what's in the chroot.
30
31 What you'd do, therefore, would be add the 32-bit binary and library paths
32 to the appropriate config scripts on the general host, and it could then
33 access them as needed.
34
35 For the standard binary/executable paths, you'd add it to the shell PATH
36 variable, taking care to deliberately add it BEFORE or AFTER the 64-bit
37 paths, depending on which ones you wanted to take precedence if there were
38 both 32-bit and 64-bit executable files of the same name.
39
40 This is exactly the same strategy admins use if they wannt stuff in
41 /usr/local/bin to execute in place of the stuff in /usr/bin, for instance.
42 Suppose you create a wrapper script that sets a few shell variables before
43 it executes the normal program, or executes the normal program, but always
44 with a specific set of command line options. It's easy to name the script
45 the same thing as the program it calls, so long as the path is set up so
46 the script is found before the main program! Here we do the same thing,
47 only we decide whether we want 32-bit or 64-bit versions to be the
48 default, and arrange the path accordingly. (It's always possible to call
49 the /other/ one by simply specifying the full path, rather than just the
50 name, and letting the shell do the work of finding it based on name only.)
51
52 For library paths, you'd create a new file in /etc/env.d that added the
53 new 32-bit library dirs to the LDPATH var. There should be a number of
54 others files already there to provide examples.
55
56 When you had it set up to your liking, you'd run env-update, which updates
57 the vars and reruns ldconfig to update the ldconfigcache with the new
58 library search paths.
59
60 Note that you'd NOT want to add the 32-bit chroot include dirs to that
61 search path, not for the main system anyway, as that would be handled in
62 the 32-bit chroot.
63
64 > BTW, I actually went through all the documentation you mention and it
65 > was very helpful. I'm just setting up an installation that's a bit more
66 > than trivial, using GCC 4 & X-server. I expect to be referring to the
67 > experience of the good folk on this list often!
68
69 That's very encouraging. Gentoo is known for having some of the best
70 documentation around, definitely better than most distributions.
71 Unfortunately, a lot of folks simply don't use it, which is a shame, given
72 all the work put into it and the fact that it's /so/ much easier if one
73 actually reads the documentation. =8^) I know I spent a quite a bit of
74 time reading, before I ever even downloaded a stage tarball to begin
75 installing with, and I'm very glad I did, as it certainly made life easier
76 for me. Thus, I always try to encourage others to read the docs too, as
77 there's just /so/ many hints there that make life /so/ much easier,
78 instead of beating your head against the wall doing it the hard way! =8^P
79
80 So... to find someone actually reading them... very encouraging! =8^)
81
82 --
83 Duncan - List replies preferred. No HTML msgs.
84 "Every nonfree program has a lord, a master --
85 and if you use the program, he is your master." Richard Stallman in
86 http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html
87
88
89 --
90 gentoo-amd64@g.o mailing list