Hello,
I'm trying to build the Linaro GCC from source on an x86_64 Fedora 16 box. I'm using as a guide a wiki entry I found in linaro.org site [1] that explains how to build a native version of the compiler. But instead of a native version I want to be able to cross-compile ARM binaries for my target machine.
This is what I tried:
[javier@munra src]$ wget -c http://launchpadlibrarian.net/86993387/gcc-linaro-4.6-2011.12.tar.bz2 [javier@munra src]$ tar xaf gcc-linaro-4.6-2011.12.tar.bz2 [javier@munra src]$ mkdir build && cd build [javier@munra build]$ ../gcc-linaro-4.6-2011.12/configure --target=arm-linux --disable-bootstrap --enable-languages=c --prefix=/home/javier/tools [javier@munra build]$ make -j4 && make install
But got this error:
make[2]: Leaving directory `/home/javier/src/build/gcc' Checking multilib configuration for libgcc... mkdir -p -- arm-linux/libgcc Configuring in arm-linux/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... gawk checking build system type... x86_64-unknown-linux-gnu checking host system type... arm-unknown-linux-gnu checking for arm-linux-ar... arm-linux-ar checking for arm-linux-lipo... arm-linux-lipo checking for arm-linux-nm... /home/javier/src/build/./gcc/nm checking for arm-linux-ranlib... arm-linux-ranlib checking for arm-linux-strip... arm-linux-strip checking whether ln -s works... yes checking for arm-linux-gcc... /home/javier/src/build/./gcc/xgcc -B/home/javier/src/build/./gcc/ -B/home/javier/tools/arm-linux/bin/ -B/home/javier/tools/arm-linux/lib/ -isystem /home/javier/tools/arm-linux/include -isystem /home/javier/tools/arm-linux/sys-include checking for suffix of object files... configure: error: in `/home/javier/src/build/arm-linux/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/javier/src/build' make: *** [all] Error 2
Before trying to compile I've installed the libgmp, libmpfr and arm cross tool-chain [2] Fedora packages so I guess all gcc dependencies are met (binutils, glibc, etc).
Could someone be so kind to point me out what am I doing wrong? I'm sending as an attachment the config.log generated file.
Please let me know if you need any more information about my setup and environment.
[1]: https://wiki.linaro.org/WorkingGroups/ToolChain/Using/GCCNative [2]: http://fedoraproject.org/wiki/Architectures/ARM/CrossToolchain
Thanks a lot and best regards, Javier
On 07/01/12 05:31, Javier Martinez Canillas wrote:
Before trying to compile I've installed the libgmp, libmpfr and arm cross tool-chain [2] Fedora packages so I guess all gcc dependencies are met (binutils, glibc, etc).
If you can build a native compiler then you have all the support library dependencies you need.
binutils and glibc are a different matter though. Before you can compile a cross compiler you need to have a matching cross-binutils installed and on the path. That's not too hard to build though.
Unfortunately, you also need a copy of glibc built for ARM (i.e. not the x86 host glibc), and you can't build that until you have a compiler, but you can't build that without glibc, but .... it's a chicken and egg problem. There *is* a solution to this problem, but it's slightly involved, and at the end you still don't have all the other useful libraries installed so you struggle to build real-world applications. I suggest you install a copy of the ARM root-filesystem, and configure gcc to use it as a "sysroot".
Hope that helps
Andrew
On Sat, Jan 7, 2012 at 6:31 PM, Javier Martinez Canillas javier@dowhile0.org wrote:
Hello,
I'm trying to build the Linaro GCC from source on an x86_64 Fedora 16 box. I'm using as a guide a wiki entry I found in linaro.org site [1] that explains how to build a native version of the compiler. But instead of a native version I want to be able to cross-compile ARM binaries for my target machine.
This is what I tried:
[javier@munra src]$ wget -c http://launchpadlibrarian.net/86993387/gcc-linaro-4.6-2011.12.tar.bz2 [javier@munra src]$ tar xaf gcc-linaro-4.6-2011.12.tar.bz2 [javier@munra src]$ mkdir build && cd build [javier@munra build]$ ../gcc-linaro-4.6-2011.12/configure --target=arm-linux --disable-bootstrap --enable-languages=c --prefix=/home/javier/tools [javier@munra build]$ make -j4 && make install
But got this error:
make[2]: Leaving directory `/home/javier/src/build/gcc' Checking multilib configuration for libgcc... mkdir -p -- arm-linux/libgcc Configuring in arm-linux/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... gawk checking build system type... x86_64-unknown-linux-gnu checking host system type... arm-unknown-linux-gnu checking for arm-linux-ar... arm-linux-ar checking for arm-linux-lipo... arm-linux-lipo checking for arm-linux-nm... /home/javier/src/build/./gcc/nm checking for arm-linux-ranlib... arm-linux-ranlib checking for arm-linux-strip... arm-linux-strip checking whether ln -s works... yes checking for arm-linux-gcc... /home/javier/src/build/./gcc/xgcc -B/home/javier/src/build/./gcc/ -B/home/javier/tools/arm-linux/bin/ -B/home/javier/tools/arm-linux/lib/ -isystem /home/javier/tools/arm-linux/include -isystem /home/javier/tools/arm-linux/sys-include checking for suffix of object files... configure: error: in `/home/javier/src/build/arm-linux/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/javier/src/build' make: *** [all] Error 2
Before trying to compile I've installed the libgmp, libmpfr and arm cross tool-chain [2] Fedora packages so I guess all gcc dependencies are met (binutils, glibc, etc).
Could someone be so kind to point me out what am I doing wrong? I'm sending as an attachment the config.log generated file.
Please let me know if you need any more information about my setup and environment.
Thanks a lot and best regards, Javier
Hi Javier. Give crosstool-NG (http://crosstool-ng.org/) a try. It hasn't been released yet, but you could try the Linaro branch which includes a Linaro sample config.
Something like: * bzr branch lp:~linaro-toolchain-dev/crosstool-ng/linaro * cd linaro * ./configure --local * export PATH=$PWD:$PATH * mkdir builds; cd builds * ct-ng linaro-arm-linux-gnueabi * ct-ng build
You might need to run a `ct-ng menuconfig` and turn off the LSB compiler but apart from that it should be good.
-- Michael
On Sun, Jan 8, 2012 at 9:33 PM, Michael Hope michael.hope@linaro.org wrote:
Hi Javier. Give crosstool-NG (http://crosstool-ng.org/) a try. It hasn't been released yet, but you could try the Linaro branch which includes a Linaro sample config.
Something like:
- bzr branch lp:~linaro-toolchain-dev/crosstool-ng/linaro
- cd linaro
- ./configure --local
- export PATH=$PWD:$PATH
- mkdir builds; cd builds
- ct-ng linaro-arm-linux-gnueabi
- ct-ng build
You might need to run a `ct-ng menuconfig` and turn off the LSB compiler but apart from that it should be good.
Hello Michael,
Thank you for your recomendation. I'll give a try to crosstool-NG Linaro branch.
Best regards,
linaro-toolchain@lists.linaro.org