compiling code for different machines
Brian Dessent
brian@dessent.net
Thu Oct 12 09:46:00 GMT 2006
Brian Dessent wrote:
> > I want to create binarys on this systems that I can use on
> > all boxes. So i tried to compile my gcc on my i686 machine
> > using
Upon re-reading your question, I might have misunderstood.
If you are asking about recompiling gcc, then that is not necessary at
all. Gcc has but a single x86 backend, and it can generate code for the
entire spectrum of x86 -march options listed in the manual. So there is
no need to rebuild gcc to generate 486 code. Just compile your software
with your normal gcc with -march=486.
The only potential reason that you might want to recompile gcc is to
change its *default* -march. This is the -march that it will use if
none is specified, and this can be set by the --with-arch configure
option when building gcc. However, going to the trouble of rebuilding
gcc just to change its default -march is massive overkill. You could
e.g. just set CFLAGS in your .bashrc so that the desired -march is
always supplied. Or you could use a config.site file to give
site-specific autoconf flags and specify CFLAGS there. Or you could
just edit gcc's specs file and add the desired -march there. None of
these require rebuilding the compiler.
Brian
More information about the Gcc-help
mailing list