* native gcc for mipsel / uClibc (building or binaries)?
@ 2006-02-12 18:18 Tomasz Chmielewski
2006-02-12 19:27 ` Ilya A. Volynets-Evenbakh
2006-02-12 21:31 ` David Daney
0 siblings, 2 replies; 8+ messages in thread
From: Tomasz Chmielewski @ 2006-02-12 18:18 UTC (permalink / raw)
To: linux-mips
I'm trying to cross-compile gcc to work on mipsel / uClibc, to run there
natively (that is, I want to compile on this mipsel / uClibc machine).
So far I have a cross compiler that builds binaries for mipsel/uClibc on
a x86 machine.
According to crosstool HOWTO, "to do a Canadian Cross build with
crosstool, you have to run it three times:
1. once to build a toolchain that runs on the build system and
generates code for the host system
2. once to build a toolchain that runs on the build system and
generates code for the target system
3. once to build a toolchain that runs on the host system and
generates code for the target system".
So I guess the first step is behind me, but I'm not sure how to do steps
2 and 3.
Anyone knows how to do it?
Or perhaps, there are already gcc binaries available for mipsel / uClibc?
--
Tomasz Chmielewski
Software deployment with Samba
http://wpkg.org
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 18:18 native gcc for mipsel / uClibc (building or binaries)? Tomasz Chmielewski @ 2006-02-12 19:27 ` Ilya A. Volynets-Evenbakh 2006-02-12 20:19 ` Tomasz Chmielewski 2006-02-12 21:31 ` David Daney 1 sibling, 1 reply; 8+ messages in thread From: Ilya A. Volynets-Evenbakh @ 2006-02-12 19:27 UTC (permalink / raw) To: Tomasz Chmielewski; +Cc: linux-mips Canadian cross is when you build toolchain on system X to run on system Y, and generate code for system Z. Are you sure it is what you want? I somehow suspect that you want to generate toolchain to build things natively on your mipsel box to run on said box. If that is true, buildroot (http://buildroot.uclibc.org) will do everything for you. Also, I think crosstool does it by default as well (not 100% sure though). Look under your destination dir for <target>/bin/gcc. Tomasz Chmielewski wrote: > I'm trying to cross-compile gcc to work on mipsel / uClibc, to run > there natively (that is, I want to compile on this mipsel / uClibc > machine). > > So far I have a cross compiler that builds binaries for mipsel/uClibc > on a x86 machine. > > > According to crosstool HOWTO, "to do a Canadian Cross build with > crosstool, you have to run it three times: > > 1. once to build a toolchain that runs on the build system and > generates code for the host system > 2. once to build a toolchain that runs on the build system and > generates code for the target system > 3. once to build a toolchain that runs on the host system and > generates code for the target system". > > So I guess the first step is behind me, but I'm not sure how to do > steps 2 and 3. > > Anyone knows how to do it? > Or perhaps, there are already gcc binaries available for mipsel / uClibc? > -- Ilya A. Volynets-Evenbakh Total Knowledge. CTO http://www.total-knowledge.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 19:27 ` Ilya A. Volynets-Evenbakh @ 2006-02-12 20:19 ` Tomasz Chmielewski 2006-02-12 20:32 ` Ilya A. Volynets-Evenbakh 0 siblings, 1 reply; 8+ messages in thread From: Tomasz Chmielewski @ 2006-02-12 20:19 UTC (permalink / raw) To: Ilya A. Volynets-Evenbakh, linux-mips Ilya A. Volynets-Evenbakh wrote: > Canadian cross is when you build toolchain on system X to run on system > Y, and generate code for system Z. all right, so I misunderstood, I need to build gcc on system X to run on system Y. > Are you sure it is what you want? I somehow suspect that you want to > generate toolchain to build things > natively on your mipsel box to run on said box. If that is true, > buildroot (http://buildroot.uclibc.org) will do everything Buildroot also builds gcc which works on let's say x86 and makes binaries for mipsel/uclibc). I need the gcc binaries which will work on mipsel, and which will build for mipsel. > for you. Also, I think crosstool does it by default as well (not 100% > sure though). Look under your destination dir > for <target>/bin/gcc. Crosstool by default builds the binaries on system X that will run on system X and build for Y. So now I have binaries that build for mipsel/uclibc on x86, but I can't build gcc that will work on mipsel/uclibc with it. -- Tomasz Chmielewski Software deployment with Samba http://wpkg.org ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 20:19 ` Tomasz Chmielewski @ 2006-02-12 20:32 ` Ilya A. Volynets-Evenbakh 2006-02-12 20:49 ` Tomasz Chmielewski 0 siblings, 1 reply; 8+ messages in thread From: Ilya A. Volynets-Evenbakh @ 2006-02-12 20:32 UTC (permalink / raw) To: Tomasz Chmielewski; +Cc: linux-mips Tomasz Chmielewski wrote: > Ilya A. Volynets-Evenbakh wrote: > >> Are you sure it is what you want? I somehow suspect that you want to >> generate toolchain to build things >> natively on your mipsel box to run on said box. If that is true, >> buildroot (http://buildroot.uclibc.org) will do everything > > > Buildroot also builds gcc which works on let's say x86 and makes > binaries for mipsel/uclibc). > > I need the gcc binaries which will work on mipsel, and which will > build for mipsel. Buildroot builds _both_. At least it has support for building both. > > >> for you. Also, I think crosstool does it by default as well (not 100% >> sure though). Look under your destination dir >> for <target>/bin/gcc. > > > Crosstool by default builds the binaries on system X that will run on > system X and build for Y. > > So now I have binaries that build for mipsel/uclibc on x86, but I > can't build gcc that will work on mipsel/uclibc with it. Let's say you build with instdir /crosstool Then look for mipsel toolchain binaries in /crosstool/gcc-x.y.z-glibc-K.L.M/mipsel-linux-gnu/mipsel-linux-gnu/bin -- Ilya A. Volynets-Evenbakh Total Knowledge. CTO http://www.total-knowledge.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 20:32 ` Ilya A. Volynets-Evenbakh @ 2006-02-12 20:49 ` Tomasz Chmielewski 0 siblings, 0 replies; 8+ messages in thread From: Tomasz Chmielewski @ 2006-02-12 20:49 UTC (permalink / raw) To: Ilya A. Volynets-Evenbakh; +Cc: linux-mips Ilya A. Volynets-Evenbakh wrote: > Tomasz Chmielewski wrote: > >> Ilya A. Volynets-Evenbakh wrote: >> >>> Are you sure it is what you want? I somehow suspect that you want to >>> generate toolchain to build things >>> natively on your mipsel box to run on said box. If that is true, >>> buildroot (http://buildroot.uclibc.org) will do everything >> >> Buildroot also builds gcc which works on let's say x86 and makes >> binaries for mipsel/uclibc). >> >> I need the gcc binaries which will work on mipsel, and which will >> build for mipsel. > > Buildroot builds _both_. At least it has support for building both. OK, than I didn't look close enough. >>> for you. Also, I think crosstool does it by default as well (not 100% >>> sure though). Look under your destination dir >>> for <target>/bin/gcc. >> >> Crosstool by default builds the binaries on system X that will run on >> system X and build for Y. >> >> So now I have binaries that build for mipsel/uclibc on x86, but I >> can't build gcc that will work on mipsel/uclibc with it. > > Let's say you build with instdir /crosstool > Then look for mipsel toolchain binaries in > /crosstool/gcc-x.y.z-glibc-K.L.M/mipsel-linux-gnu/mipsel-linux-gnu/bin It's all x86 cross compilers (they will build for mipsel, on x86): # pwd /opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/mipsel-unknown-linux-uclibc/bin # file gcc gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped # pwd /opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/bin # file mipsel-unknown-linux-uclibc-gcc mipsel-unknown-linux-uclibc-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped So I guess I need to spend some more time on it, if I don't figure out, I'll keep on asking :) -- Tomasz Chmielewski Software deployment with Samba http://wpkg.org ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 18:18 native gcc for mipsel / uClibc (building or binaries)? Tomasz Chmielewski 2006-02-12 19:27 ` Ilya A. Volynets-Evenbakh @ 2006-02-12 21:31 ` David Daney 2006-02-12 21:48 ` Tomasz Chmielewski 1 sibling, 1 reply; 8+ messages in thread From: David Daney @ 2006-02-12 21:31 UTC (permalink / raw) To: Tomasz Chmielewski; +Cc: linux-mips Tomasz Chmielewski wrote: > I'm trying to cross-compile gcc to work on mipsel / uClibc, to run there > natively (that is, I want to compile on this mipsel / uClibc machine). > > So far I have a cross compiler that builds binaries for mipsel/uClibc on > a x86 machine. > > > According to crosstool HOWTO, "to do a Canadian Cross build with > crosstool, you have to run it three times: > > 1. once to build a toolchain that runs on the build system and > generates code for the host system > 2. once to build a toolchain that runs on the build system and > generates code for the target system > 3. once to build a toolchain that runs on the host system and > generates code for the target system". > > So I guess the first step is behind me, but I'm not sure how to do steps > 2 and 3. > > Anyone knows how to do it? > Or perhaps, there are already gcc binaries available for mipsel / uClibc? > I have done it for mipsel-linux-glibc, however until last week gcc had no support for uClibc, so it will probably not work with uClibc without some patching to gcc. The basic idea is that once you have a working cross toolchain just configure gcc and binutils with: --build=i686-pc-linux-glibc --target=mipsel-linux --host=mipsel-linux. This will produce a native toolchain. You will have to copy the compile time portions of the C library (include files and link time libraries) to the target, then you should be all set. David Daney. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 21:31 ` David Daney @ 2006-02-12 21:48 ` Tomasz Chmielewski 2006-02-13 10:35 ` Richard Sandiford 0 siblings, 1 reply; 8+ messages in thread From: Tomasz Chmielewski @ 2006-02-12 21:48 UTC (permalink / raw) To: David Daney; +Cc: linux-mips David Daney wrote: > I have done it for mipsel-linux-glibc, however until last week gcc had > no support for uClibc, so it will probably not work with uClibc without > some patching to gcc. > > The basic idea is that once you have a working cross toolchain just > configure gcc and binutils with: --build=i686-pc-linux-glibc > --target=mipsel-linux --host=mipsel-linux. This will produce a native > toolchain. You will have to copy the compile time portions of the C > library (include files and link time libraries) to the target, then you > should be all set. Exactly that's my problem. I have a compiler that generates binaries for mipsel/uclibc. I compiled lots of software with it, so we can say it's functional. Now, when I try to compile gcc (--build=i686-pc-linux-glibc > --target=mipsel-linux --host=mipsel-linux), it breaks, as during the build process gcc's ./configure has a schizophrenia: it tries to compile some parts for mipsel (as I'd expect), but it also tries to compile and execute the binaries during the build process. This means, it creates some binaries/libs needed for the build process (like libiberty), then tries to run/use them, but as they are mipsel binaries, the build process breaks. I tried that with gcc-4.0.2, and some earlier 3.3.6 and 3.4.5, without a success. -- Tomasz Chmielewski Software deployment with Samba http://wpkg.org ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: native gcc for mipsel / uClibc (building or binaries)? 2006-02-12 21:48 ` Tomasz Chmielewski @ 2006-02-13 10:35 ` Richard Sandiford 0 siblings, 0 replies; 8+ messages in thread From: Richard Sandiford @ 2006-02-13 10:35 UTC (permalink / raw) To: Tomasz Chmielewski; +Cc: David Daney, linux-mips Tomasz Chmielewski <mangoo@wpkg.org> writes: > Now, when I try to compile gcc (--build=i686-pc-linux-glibc > > --target=mipsel-linux --host=mipsel-linux), it breaks, as during the > build process gcc's ./configure has a schizophrenia: it tries to compile > some parts for mipsel (as I'd expect), but it also tries to compile and > execute the binaries during the build process. Just to rule out one possibility, were the x86-hosted tools in your path when you ran configure and make? They need to be. > This means, it creates some binaries/libs needed for the build process > (like libiberty), then tries to run/use them, but as they are mipsel > binaries, the build process breaks. Recent versions compile two versions of libiberty, one for the build machine and one for the host. The build version is used for things like genattrtab (a build-time tool used only to build gcc itself) while the host version is linked into the final compilers. Richard ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-02-13 10:29 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-02-12 18:18 native gcc for mipsel / uClibc (building or binaries)? Tomasz Chmielewski 2006-02-12 19:27 ` Ilya A. Volynets-Evenbakh 2006-02-12 20:19 ` Tomasz Chmielewski 2006-02-12 20:32 ` Ilya A. Volynets-Evenbakh 2006-02-12 20:49 ` Tomasz Chmielewski 2006-02-12 21:31 ` David Daney 2006-02-12 21:48 ` Tomasz Chmielewski 2006-02-13 10:35 ` Richard Sandiford
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.