Programming This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-28-2009, 02:10 AM
|
#1
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Rep:
|
compiling cross gcc for powerpc, glibc trouble
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!!!
|
|
|
|
05-28-2009, 02:30 AM
|
#2
|
|
Senior Member
Registered: May 2005
Posts: 4,420
|
Quote:
Originally Posted by and73y
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.
Read http://blog.aurel32.net/?p=47 and links there to see the whole picture.
Your best hope is to try to find the needed info on the WEB.
Try also this repo:
http://www.eglibc.org/archives/issues/msg00034.html ->
http://toolchain.freesa.org/eglibc-tarballs/
- haven't tried it myself.
|
|
|
|
05-28-2009, 07:20 AM
|
#3
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,595
|
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?
|
|
|
|
05-28-2009, 08:58 AM
|
#4
|
|
Senior Member
Registered: May 2005
Posts: 4,420
|
Quote:
Originally Posted by gnashley
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.
If you are interested in the details, read
http://sourceware.org/bugzilla/show_bug.cgi?id=10062
http://sourceware.org/bugzilla/show_bug.cgi?id=10063
.
|
|
|
|
05-28-2009, 09:49 AM
|
#5
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,321
|
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.
|
|
|
|
05-29-2009, 07:44 AM
|
#6
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Original Poster
Rep:
|
2gnashley
I'm trying to build:
1. binutils-2.19
2. glibc-2.9
3. gcc-4.4.0
binutils and simple version of gcc were built and installed sucessfully in prefix path
2theNbomr
I've download crosstool-0.43:
gcc-4.4.0-glibc-2.xx... .dat
contains:
BINUTILS_DIR=binutils-2.19
GCC_DIR=gcc-4.0.0
GLIBC_DIR=glibc-2.3.5
LINUX_DIR=linux-2.6.15.4
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.5
but I haven't target linux distrib (LINUX_DIR), I have only target sys-includes and device on desktop with BusyBox kernel 2.4.26 (special build)
Last edited by and73y; 05-29-2009 at 07:46 AM.
|
|
|
|
05-29-2009, 08:42 AM
|
#7
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,595
|
Are you setting your PATH so that your new binutils and gcc are being used instead of the regular ones?
|
|
|
|
05-29-2009, 10:06 AM
|
#8
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,321
|
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.
Last edited by theNbomr; 05-29-2009 at 04:17 PM.
|
|
|
|
06-01-2009, 05:06 AM
|
#9
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Original Poster
Rep:
|
gnashley:
Yes! After step 2:
export PATH=$PATH:/powerpc:/powerpc/bin
theNbomr:
Thank you. I'll try your way.
|
|
|
|
06-01-2009, 07:29 AM
|
#10
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,595
|
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
|
|
|
|
06-02-2009, 02:01 AM
|
#11
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Original Poster
Rep:
|
I've change PATH variable, but no effect(
the same error
/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
|
|
|
|
06-02-2009, 03:46 AM
|
#12
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,595
|
Try exporting LD_LIBRARY_PATH so it points to the right libs.
|
|
|
|
06-03-2009, 05:41 AM
|
#13
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Original Poster
Rep:
|
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).
the same problem:
http://gcc.gnu.org/ml/gcc-help/2009-04/msg00240.html
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."
How to build crt1.o for powerpc?
Last edited by and73y; 06-03-2009 at 05:46 AM.
|
|
|
|
06-04-2009, 05:55 PM
|
#14
|
|
LQ Newbie
Registered: Jun 2009
Posts: 2
Rep:
|
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).
|
|
|
|
06-05-2009, 04:21 AM
|
#15
|
|
LQ Newbie
Registered: May 2009
Location: Ekb, Russia
Distribution: Slackware 12.2
Posts: 6
Original Poster
Rep:
|
http://gcc.gnu.org/ml/gcc-help/2007-06/msg00020.html
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((
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:10 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|