This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: x32_64 cross compiler
On Nov 12, 2007 8:11 AM, Andrew Haley <aph-gcc@littlepinkcloud.com> wrote:
> NightStrike writes:
> > On Nov 10, 2007 3:57 PM, Diego . <eljedi@gmail.com> wrote:
> > > On Nov 10, 2007 5:49 PM, NightStrike <nightstrike@gmail.com> wrote:
> > > > On Nov 10, 2007 7:35 AM, Diego . <eljedi@gmail.com> wrote:
> > > > > Hello!!
> > > > >
> > > > > I'm triying to build a cross compiler for x32_64. I want to be able to
> > > > > build 64bits files from my 32bits linux machine.
> > > > >
> > > > > The problem i got now is some error, i tried some differents flags on
> > > > > configure. One of them is: --target=x86_64-pc-linux-gnu , is it well?
> > > > > or the parameter should be another combination of the triplets?
> > > > >
> > > > > Thanks,
> > > > > Diego.
> > > > To build a cross compiler, you need a complete toolchain that targets
> > > > the environment that interests you. In your case, you need to build
> > > > binutils with --target=x86_64-pc-linux, then a basic gcc (do make
> > > > all-gcc and make install-gcc), then a complete glibc using the basic
> > > > gcc you just build (when building the libc, target becomes host, host
> > > > becomes build, and build goes away). Make and install that after
> > > > placing the basic gcc first in your PATH. Then go back to the basic
> > > > gcc and do a full make / install.
> > > >
> > > > That's the quick and dirty outline method.
> >
> > > Thanks nightStrike for te quick reply
> > >
> > > There's a clean method to build it? or better, any web thar explains that?
> > >
> > > Thanks again!!
> >
> > There's a program called "crosstool" that automates the process,
> > though I've found it easier to just do it myself assuming you have all
> > the tools in place that you need. Check here:
> > http://www.kegel.com/crosstool/current/doc/crosstool-howto.html
> >
> > If you get stuck, I could probably build you a toolchain real fast and
> > send you a log of what I did so that you can see each command and how
> > it works.
>
> This is an excruciatingly hard way to build a Linux-Linux cross
> compiler. The easy way is to copy libraries from a 64-bit Linux
> system to a 32-bit system and then to build the compiler with
>
> --enable-targets=all
>
> Andrew.
Right... because everyone with a 32-bit linux system has a running
64-bit system available from which to copy system
libraries.....................
The guy is building a cross compiler, not a native compiler.