LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.
BooksAll ArticlesSafari BookshelfO'Reilly GearFree Newsletters

FAQS
 FAQs
Apache FAQ
Linux FAQ
XML FAQ

Log in to particpate





TECH JOBS


   Linux FAQ > 6. Porting, Compiling and Obtaining Programs
Question:  6.7. How To Use Code or a Compiler Compiled for a 486 on a 386.
Answer:

Yes, unless it's the kernel.

The -m486 option to GCC, which is used to compile binaries for x486 machines, merely changes certain optimizations. This makes for slightly larger binaries that run somewhat faster on a 486. They still work fine on a 386, though, with a small performance hit.

However, from version 1.3.35 the kernel uses 486 or Pentium-specific instructions if configured for a 486 or Pentium, thus making it unusable on a 386.

GCC can be configured for a 386 or 486; the only difference is that configuring it for a 386 makes -m386 the default and configuring for a 486 makes -m486 the default. In either case, these can be overridden on a per-compilation basis or by editing /usr/lib/gcc-lib/i*-linux/ n.n.n/specs.

There is an alpha version of GCC that knows how to do optimization well for the 586, but it is quite unreliable, especially at high optimization settings. The Pentium GCC can be found on ftp://tsx-11.mit.edu/pub/linux/ALPHA/pentium-gcc/. The ordinary 486 GCC supposedly produces better code for the Pentium using the -m386, or at least slightly smaller.


This FAQ is from Linux Frequently Asked Questions with Answers, maintained by Robert Kiesling

Sponsored by:

Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly
Copyright © 2000-2006 O’Reilly Media, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
For problems or assistance with this site, email