On Fri, Aug 31, 2007 at 04:54:50PM -0500, Bruce Dubbs wrote: > I'd like to see the question answered. "I have a 64-bit system. How > can I build a 32-bit system?"
Well, that's an easy answer. "Boot a x86 (or 32-bit) kernel and build for x86. The default on the x86 LiveCD works perfectly." > There also needs to be more explanation in the text interspersed with > the instructions. For instance in "5.4. GCC-4.2.1 - Pass 1" we have: > > "Also, the --with-arch flag is only necessary for x86 machines." > > The WITHARCH variable seems to be a configure option, but I can't find > it in ./configure --help or with a grep of configure. In any case, I > have Pentium 4 CPU. Why do I want to use --with-arch=i486 instead of > --with-arch=pentium4. The top-level configure doesn't make use of it, but the value is carried over to the sub-configure scripts which do use it. Although, from a cursory examination, it doesn't seem to be used specifically for x86 machines. I'll have to look closer, but I know from experience that it allows Glibc to build whereas it wouldn't before. In any case, yes, there needs to be more description here. I admit I was lazy on that - I was more interested at the time in getting the commands tested. As Greg mentioned, by using --with-arch, we are effectively introducing optimization into the build. Much text in the book needs to be adjusted to show why we are using this and what is considered 'safe'. Also, AFAIK, you could conceivably use pentium4, or whatever fits your CPU - again, it's optimization. > The M64 variable on the other hand is a gcc compiler option. Why are we > using -m64 for 64 bit architectures? The info page says that is a > deprecated option. Hrm? The man page for gcc 4.2.1 still lists it under 'i386 and x86-64 Options' And then it says: "The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture." Perhaps you were looking under the wrong architecture? Anyway, we use it twice, once for binutils pass 1 and once for gcc pass 1. In each case, the idea is that it forces the compiler to build 64-bit binaries in case it is a multilib system and the default is set to build 32-bit binaries. Since we're currently not supporting the build of a multilib LFS, we want to produce 64-bit only. Once we build a 64-bit ld and a 64-bit gcc, we will by default be producing 64 bit. For most 64-bit hosts, the default is to build 64-bit, so for most cases the use of '-m64' isn't even necessary for those two cases. But it can't hurt to be explicit until we know for sure what we're producing. -- JH -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page