Gentoo Archives: gentoo-amd64

From: Samir Mishra <sqmishra@×××.ae>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: Re: Difference between multilib & no-multilib stages
Date: Sat, 22 Apr 2006 12:23:06
Message-Id: 444A1E13.5000909@eim.ae
In Reply to: [gentoo-amd64] Re: Re: Difference between multilib & no-multilib stages by Duncan <1i5t5.duncan@cox.net>
1 I guess my assuming that I can change the bit-ness of the compilation
2 via the CHOST variable is a misunderstanding on my part.
3
4 If my primary Gentoo install is using the multilib libraries, can I just
5 move application packages from a 32-bit chroot to the former and
6 expect things to work? I've set up glibc with nptl-only. I was planning
7 to set up a pure 32-bit and pure 64-bit chroot environments. The latter
8 would have served as a development setup, allowing me to complete all
9 compiles and move the working applications from the 64-bit chroot to the
10 main Gentoo instance.
11
12 BTW, I actually went through all the documentation you mention and it
13 was very helpful. I'm just setting up an installation that's a bit more
14 than trivial, using GCC 4 & X-server. I expect to be referring to the
15 experience of the good folk on this list often!
16
17 Thanks again.
18
19 Samir.
20
21 Duncan wrote:
22 > Samir Mishra posted <4448CA27.8020804@×××.ae>, excerpted below, on Fri,
23 > 21 Apr 2006 16:03:51 +0400:
24 >
25 >
26 >>> However, 32-bit is possible by adding the appropriate CFLAGS.
27 >>>
28 >> I assume this can be achieved by switching the CHOST environment
29 >> variable to the X86 relevant one. In this instance, if I change the
30 >> CHOST variable, is it also necessary to add -m32 to the CFLAGS, or for
31 >> that matter, make any changes to the C[XX]FLAGS?
32 >>
33 >
34 > I'm not sure about the effect of CHOST. The docs mention -m32 (and -m64)
35 > in CFLAGS, and that's the way they manage it with the glibc and grub
36 > ebuilds.
37 >
38 > Other changes to the CFLAGS would depend... Some CFLAGS work on both but
39 > the effect is somewhat different (-fomit-frame-pointer kills certain
40 > debugging on x86, but not on amd64/x86_64). Some don't work on on both
41 > (certain alignment flags), or don't work on all x86 sub-archs (SSE/MMX and
42 > the like). However, if you stick to the recommended -O2 -pipe (and
43 > possibly -fomit-frame-pointer if you don't care about the debugging on
44 > x86), -m32/64 is the only one to worry about, and again, I'm not sure how
45 > that works against CHOST. (-O flags will change their behavior based on
46 > arch, but in /general/, the idea is to only select the generally safe
47 > optimizations for a platform and include those in the various levels of
48 > -O, as appropriate.)
49 >
50 >
51 >> Also, given that I have the multilib libraries installed, is there any
52 >> way to ensure that only the 64-bit libraries are used when compiling, in
53 >> effect disable all 32-bit libraries during the compile stage? I'm more
54 >> interested in having things work, but I would like to keep track of all
55 >> packages that use any of the 32-bit libraries and upgrade these to the
56 >> full 64-bit versions when updates to the packages are available.
57 >>
58 >
59 > As I said, you don't really need to do that, because if it's a 32-bit
60 > package, it can only use 32-bit libraries; if it's a 64-bit package, it
61 > can only use 64-bit libraries. The only exceptions in portage are well
62 > known -- gcc, glibc, sandbox, grub, and the 32-bit bin/compatibility
63 > packages that don't compile anything but simply install precompiled 32-bit
64 > binaries for compatibility purposes. gcc does both in ordered to be
65 > multilib. glibc actually compiles separate libraries for 32-bit and
66 > 64-bit -- it iterates thru the build process up to four times, once each
67 > for nptl and linux threads (if so configured), for each of 32-bit and
68 > 64-bit (on a multilib profile). sandbox likewise duplicates the build
69 > process, building both a 32-bit lib and a 64-bit lib, so it can provide
70 > the sandbox services to both bitnesses. grub is 32-bit only, because the
71 > hardware /must/ start in 32-bit mode and only switches to 64-bit mode
72 > after the kernel loads.
73 >
74 > Anything that you compile outside of portage, presumably, you know and
75 > deliberately tell it which bitness to compile for.
76 >
77 > Thus, the only cases where an unintended bitness libraries are used are
78 > accidents, and in those cases, gcc will bail anyway, not completing the
79 > build, because it simply /cannot/ link 32-bit and 64-bit together.
80 >
81 > (The exception is where special thunking layers are designed in. The
82 > partially binary-only slaveryware that's NVidia's videodrivers are an
83 > example of this. However, again, this is going to be very rare as it's a
84 > huge pain to do, so anything that does it you'll know about, because it
85 > will be a feature of the product.)
86 >
87 > Here are some interesting links you may have missed.
88 >
89 > The handbook, which you already mentioned, but for completeness. Note
90 > that many folks only read the installation section, and miss the many
91 > good hints about actually working with and sysadmin-ing their Gentoo
92 > system. The Working with Gentoo and Working with Portage sections should
93 > also be at least scanned, and the network section can be very helpful for
94 > those setting it up for the first time as well:
95 >
96 > http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml
97 >
98 > Gentoo AMD64 FAQ, which deals with some of this:
99 >
100 > http://www.gentoo.org/doc/en/gentoo-amd64-faq.xml
101 >
102 > The now deprecated Technotes. Most of the stuff here is covered in the
103 > FAQ, but here's a somewhat dated historical viewpoint. Still well worth
104 > the read, as they deal with some of these questions as well.
105 >
106 > http://www.gentoo.org/proj/en/base/amd64/technotes/index.xml
107 >
108 > The 32-bit chroot guide. If you decide you'll be doing a lot of 32-bit
109 > stuff, this is the way to go.
110 >
111 > http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=2
112 >
113 >
114
115
116
117
118 --
119 gentoo-amd64@g.o mailing list

Replies

Subject Author
[gentoo-amd64] Re: Difference between multilib & no-multilib stages Duncan <1i5t5.duncan@×××.net>