1 |
Samir Mishra posted <4448CA27.8020804@×××.ae>, excerpted below, on Fri, |
2 |
21 Apr 2006 16:03:51 +0400: |
3 |
|
4 |
>> However, 32-bit is possible by adding the appropriate CFLAGS. |
5 |
> |
6 |
> I assume this can be achieved by switching the CHOST environment |
7 |
> variable to the X86 relevant one. In this instance, if I change the |
8 |
> CHOST variable, is it also necessary to add -m32 to the CFLAGS, or for |
9 |
> that matter, make any changes to the C[XX]FLAGS? |
10 |
|
11 |
I'm not sure about the effect of CHOST. The docs mention -m32 (and -m64) |
12 |
in CFLAGS, and that's the way they manage it with the glibc and grub |
13 |
ebuilds. |
14 |
|
15 |
Other changes to the CFLAGS would depend... Some CFLAGS work on both but |
16 |
the effect is somewhat different (-fomit-frame-pointer kills certain |
17 |
debugging on x86, but not on amd64/x86_64). Some don't work on on both |
18 |
(certain alignment flags), or don't work on all x86 sub-archs (SSE/MMX and |
19 |
the like). However, if you stick to the recommended -O2 -pipe (and |
20 |
possibly -fomit-frame-pointer if you don't care about the debugging on |
21 |
x86), -m32/64 is the only one to worry about, and again, I'm not sure how |
22 |
that works against CHOST. (-O flags will change their behavior based on |
23 |
arch, but in /general/, the idea is to only select the generally safe |
24 |
optimizations for a platform and include those in the various levels of |
25 |
-O, as appropriate.) |
26 |
|
27 |
> Also, given that I have the multilib libraries installed, is there any |
28 |
> way to ensure that only the 64-bit libraries are used when compiling, in |
29 |
> effect disable all 32-bit libraries during the compile stage? I'm more |
30 |
> interested in having things work, but I would like to keep track of all |
31 |
> packages that use any of the 32-bit libraries and upgrade these to the |
32 |
> full 64-bit versions when updates to the packages are available. |
33 |
|
34 |
As I said, you don't really need to do that, because if it's a 32-bit |
35 |
package, it can only use 32-bit libraries; if it's a 64-bit package, it |
36 |
can only use 64-bit libraries. The only exceptions in portage are well |
37 |
known -- gcc, glibc, sandbox, grub, and the 32-bit bin/compatibility |
38 |
packages that don't compile anything but simply install precompiled 32-bit |
39 |
binaries for compatibility purposes. gcc does both in ordered to be |
40 |
multilib. glibc actually compiles separate libraries for 32-bit and |
41 |
64-bit -- it iterates thru the build process up to four times, once each |
42 |
for nptl and linux threads (if so configured), for each of 32-bit and |
43 |
64-bit (on a multilib profile). sandbox likewise duplicates the build |
44 |
process, building both a 32-bit lib and a 64-bit lib, so it can provide |
45 |
the sandbox services to both bitnesses. grub is 32-bit only, because the |
46 |
hardware /must/ start in 32-bit mode and only switches to 64-bit mode |
47 |
after the kernel loads. |
48 |
|
49 |
Anything that you compile outside of portage, presumably, you know and |
50 |
deliberately tell it which bitness to compile for. |
51 |
|
52 |
Thus, the only cases where an unintended bitness libraries are used are |
53 |
accidents, and in those cases, gcc will bail anyway, not completing the |
54 |
build, because it simply /cannot/ link 32-bit and 64-bit together. |
55 |
|
56 |
(The exception is where special thunking layers are designed in. The |
57 |
partially binary-only slaveryware that's NVidia's videodrivers are an |
58 |
example of this. However, again, this is going to be very rare as it's a |
59 |
huge pain to do, so anything that does it you'll know about, because it |
60 |
will be a feature of the product.) |
61 |
|
62 |
Here are some interesting links you may have missed. |
63 |
|
64 |
The handbook, which you already mentioned, but for completeness. Note |
65 |
that many folks only read the installation section, and miss the many |
66 |
good hints about actually working with and sysadmin-ing their Gentoo |
67 |
system. The Working with Gentoo and Working with Portage sections should |
68 |
also be at least scanned, and the network section can be very helpful for |
69 |
those setting it up for the first time as well: |
70 |
|
71 |
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml |
72 |
|
73 |
Gentoo AMD64 FAQ, which deals with some of this: |
74 |
|
75 |
http://www.gentoo.org/doc/en/gentoo-amd64-faq.xml |
76 |
|
77 |
The now deprecated Technotes. Most of the stuff here is covered in the |
78 |
FAQ, but here's a somewhat dated historical viewpoint. Still well worth |
79 |
the read, as they deal with some of these questions as well. |
80 |
|
81 |
http://www.gentoo.org/proj/en/base/amd64/technotes/index.xml |
82 |
|
83 |
The 32-bit chroot guide. If you decide you'll be doing a lot of 32-bit |
84 |
stuff, this is the way to go. |
85 |
|
86 |
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=2 |
87 |
|
88 |
-- |
89 |
Duncan - List replies preferred. No HTML msgs. |
90 |
"Every nonfree program has a lord, a master -- |
91 |
and if you use the program, he is your master." Richard Stallman in |
92 |
http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html |
93 |
|
94 |
|
95 |
-- |
96 |
gentoo-amd64@g.o mailing list |