ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am building a gcc cross compiler for powerpc on Slackware 12.2.
I did several steps:
1. make binutils
configure --target=powerpc-88x-linux-gnu --prefix=/powerpc --enable-languages=c,c++
make
2. make cross gcc
configure --target=powerpc-88x-linux-gnu --prefix=/powerpc --disable-shared --disable-threads --enable-languages=c
make
3. make glibc
configure --prefix=/powerpc --build=i686-pc-linux-gnu --host=powerpc-88x-linux-gnu --enable-add-ons=nptl --with-headers=/powerpc/powerpc-88x-linux-gnu/sys-include --with-binutils=/powerpc/powerpc-88x-linux-gnu/bin
I have error on this step:
checking for forced unwind support... no
configure: error: forced unwind support is required
config.log:
...
configure:27: checking for forced unwind support
configure:56: powerpc-88x-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5
/powerpc/lib/gcc/powerpc-88x-linux-gnu/4.4.0/../../../../powerpc-88x-linux-gnu/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
...
I am building a gcc cross compiler for powerpc on Slackware 12.2.
I did several steps:
1. make binutils
configure --target=powerpc-88x-linux-gnu --prefix=/powerpc --enable-languages=c,c++
make
2. make cross gcc
configure --target=powerpc-88x-linux-gnu --prefix=/powerpc --disable-shared --disable-threads --enable-languages=c
make
3. make glibc
configure --prefix=/powerpc --build=i686-pc-linux-gnu --host=powerpc-88x-linux-gnu --enable-add-ons=nptl --with-headers=/powerpc/powerpc-88x-linux-gnu/sys-include --with-binutils=/powerpc/powerpc-88x-linux-gnu/bin
I have error on this step:
checking for forced unwind support... no
configure: error: forced unwind support is required
config.log:
...
configure:27: checking for forced unwind support
configure:56: powerpc-88x-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5
/powerpc/lib/gcc/powerpc-88x-linux-gnu/4.4.0/../../../../powerpc-88x-linux-gnu/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
...
Please tell me what's wrong!!!
glibc developers are very unfriendly regarding bugs in glibc build mechanism.
For example, I managed to build (non-cross) glibc-2.9, but under exactly the same settings I can't build glibc-2.10.1.
While trying to build and test glibc-2.9 I filed a number of bug reports, and dealing with the developers was a disaster.
What version of glibc are you trying to build? Did binutils and gcc build okay and are installed and in the path when you try to build glibc?
I have both gcc-4.3.3 and binutils-2.19.1; everything is built automatically, and overall I have about 300 items built this way - glibc is the nastiest one so far.
As you have discovered, there are a lot of details involved with building cross toolchains. May I suggest using a tool that is made for the purpose, such as crosstool, the newer and still supported crosstool-ng, or openembedded? These packages are built to look after all of the details of building cross toolchains, and are able to produce them for a large matrix of compiler versions, glibc versions, and target CPUs. I have successfully built kernels and applications with toolchains I created using both crosstool and crosstool-ng. I am about to explore the openemedded package in the near future. Crosstool-ng has a very active mailing list, although it seems less geared toward helping end users than toward people developing the crosstool-ng package itself.
--- rod.
Okay, I'm no expert on the subject (which is why I rely on the tool to do the right things), and I don't completely understand your question. To be honest, I've always used the 'demo-XXX.sh' scripts, with my basic target directories specified, and then allowed the tool to do what it needs. My belief is that the tool downloads and builds a 'standard' native compiler (and related components), and then uses that native compiler to build all of the subsequent cross development tools and libraries. The reference to linux-2.6.15.4 is saying that the first-stage native compiler is to be built against linux kernel 2.6.15.4, and the necessary parts from that kernel will be downloaded and used as part of the crosstool first stage process. After creating a cross toolchain, in my crosstool directory tree, I find a collection of directories name 'build-binutils', 'build-gcc', etc. I also find a complete, or near complete, linux source tree, the version of which I have never installed or used, but which agrees with the version specified by the 'LINUX_DIR=' entry in my xxxx.dat file. These seem to be the standard core native components with which all of the actual cross toolchain components are built.
The idea of building everything from a standard base compiler & kernel seems to make sense from the perspective of achieving consistent results. On my installed package, it seems to want to build gcc-3.3.6 as the standard 'core' compiler, and use linux-2.6.15.4 as the basis for the kernel version. This kind of attention to consistency and thoroughness is what I found attractive about using crosstool as opposed to trying to roll my own procedure.
Your requirements, in terms of versions of glibc and gcc don't seem to be a standard combination in the package I presently have installed, but it seems reasonable that you could create an appropriate configuration file, as you have apparently already done, and as long as the versions you specify are realistic, it should be expected to work.
If someone knows more or has knowledge contrary to my understanding, I hope they will please speak up here. Hope this helps.
--- rod.
This:
export PATH=$PATH:/powerpc:/powerpc/bin
needs to be this:
export PATH=/powerpc:/powerpc/bin:$PATH
so that your new tools get picked up *before* the ones in the existing PATH
You can check to make sure things are working right like this:
which gcc
export PATH=/powerpc:/powerpc/bin:$PATH
which gcc
I have only:
/usr/lib/crt1.o
but this file is intended for my machine (i686-pc-linux-gnu).
I think that glibc needs another crt1.o - for target mashine (powerpc).
solution:
"This is a typical bootstrap problem when building a cross-compiler to
GNU/Linux: crt1.o comes from glibc, but you can't configure glibc
without crt1.o. The solution is to build glibc twice."
Hi, I am new to these forums and to Linux and to making and building my own cross compiler environments. In my first days of trying, I too have encountered these problems when trying to configure and make build glibc. It just always errors out with something or other.
I am using Debian Linux Lenny 5.0.1 and kernel 2.6.29.2-686 on a Toshiba Intel Centrino (i686)PC.
I have successfully make, compile and install binutils 2.19.1 and gcc-4.4.0 as a plain vanilla local host compiler and as an arm-linux cross compiler. But am un-able to make build nor install any of these glibc source packages. What the heck? Time consuming searching all over the net for solution(s).
There are 3 solutions:
1. To take working libc under target machine and then trying to build glibc.
2. To build gcc and glibc in the same tree.
3. To use crosstool.
Now I try to carry out the second way without success((
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.