On 9/20/07, Joshua Shriver <[EMAIL PROTECTED]> wrote: > > My main questions is, how do you go about compiling for a general > CPU so it can be portable? My desktop machine is a P4 and since I dont > want the binaries to be P4 specific, figured I'd have to do something > like -arch=386 etc. What do other distributions use so they work on > the average x86 based machine while not being too out of date. Figured > 386 mode would be to out of date, given 90+% of all x86 machines will > be at least P2, P3 or better. Perhaps -arch=686? > > Once the type is found out how do you apply this toward all > compilations? export CC=-arch=686?
I haven't actually looked at this much, but you should be fine to build binaries for x86 out of the box. It looks like (in gcc-4.1.2, anyway) you'll get i386 arch binaries by default. Then, if the host building gcc is an i686, it will default to -mcpu=pentiumpro. There are configure switches to change the target defaults for gcc, but I wouldn't play with them too much as they can bork your glibc. However, you should see the GCC install manual if you're interested: http://gcc.gnu.org/install/configure.html With gcc-4.2, there is a new "generic" cpu type for x86 that most distros are using, I think. http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options -- Dan -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
