Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
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.
|
 |
09-15-2006, 02:12 AM
|
#1
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Rep:
|
crosstool usage
Hi,
For the past two days im trying to build a cross compiler gcc for my target platform. Right now my host is i686-pc-linux-gnu and im trying to build cross compiler for the target platform x86_64-linux-gnu.
Initially i tried build on my own by installing binutils and configuring gcc pointing to this binutils for the target as and ar.
But i learnt this cross compiler needs more than what i did and started using crosstool.
I used the script demo-x86_64.sh and uncommented the line
eval `cat x86_64-static.dat gcc-3.4.3-glibc-2.3.2.dat` sh all.sh --notest
while running this script it asked for newer version of binutils, linux-2.xxx ,glibc libraries etc and i downloaded allthose files and put into the configured tarballs directory.
On running this further, i got a bug ..
/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-3.4.3-glibc-2.3.2/build-glibc/math/s_scalbnl.o
../sysdeps/ieee754/ldbl-96/s_scalbnl.c: In function `__scalbnl':
../sysdeps/ieee754/ldbl-96/s_scalbnl.c:70: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-3.4.3-glibc-2.3.2/build-glibc/math/s_scalbnl.o] Error 1
make[2]: Leaving directory `/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-3.4.3-glibc-2.3.2/glibc-2.3.2/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-3.4.3-glibc-2.3.2/glibc-2.3.2'
make: *** [all] Error 2
So i thought this would be the problem with gcc-3.4.3 and rerun the script with gcc-4.0.2 with newer versions of linux and binutils and i still got the same bug ( shown below)..
.0.2-glibc-2.3.2/gcc-core-prefix/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.6/include -isystem /opt/crosstool/gcc-4.0.2-glibc-2.3.2/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-4.0.2-glibc-2.3.2/build-glibc/math/s_scalbnl.o
../sysdeps/ieee754/ldbl-96/s_scalbnl.c: In function `__scalbnl':
../sysdeps/ieee754/ldbl-96/s_scalbnl.c:70: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-4.0.2-glibc-2.3.2/build-glibc/math/s_scalbnl.o] Error 1
make[2]: Leaving directory `/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-4.0.2-glibc-2.3.2/glibc-2.3.2/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/gobi/crosstool-0.42/build/x86_64-unknown-linux-gnu/gcc-4.0.2-glibc-2.3.2/glibc-2.3.2'
make: *** [all] Error 2
So someone please help me to build a cross compiler. Im a newbie to this field and struggling to do this for the past two days..
|
|
|
09-16-2006, 02:17 PM
|
#2
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
I think if it was a problem with your cross-compile setup then gcc would just bail out. As it is segfaulting you should listen to the message and report it.
Can you cross compile anything?
Can you write or download a really simple single source file C program and compile that?
|
|
|
09-16-2006, 03:04 PM
|
#3
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
It's odd that both compilers should bail out at the same line of
code. If the problem occurred at different (random) locations I
would have said you have problems with your RAM. If you fire up
some other (largish) program (like mozilla) and compile again, does
it still die at the same spot?
Cheers,
Tink
|
|
|
09-17-2006, 04:29 AM
|
#4
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Original Poster
Rep:
|
hi,
Im on leave today. Will check it and post tommorrow..
Thanks
Gk
|
|
|
09-18-2006, 05:10 AM
|
#5
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Original Poster
Rep:
|
Quote:
Originally Posted by bulliver
I think if it was a problem with your cross-compile setup then gcc would just bail out. As it is segfaulting you should listen to the message and report it.
Can you cross compile anything?
Can you write or download a really simple single source file C program and compile that?
|
Yes.. I can compile a C file and generate 32-bit binary. But i need to generate 64-bit binary from which im working on.
Is there anyother way to get this done?
From what i learnt, for 64-bit support we need those binutils and glibc for 64-bit. But where do i get the glibc-64-bit.
Pl help me to solve this..
|
|
|
09-18-2006, 05:11 AM
|
#6
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
It's odd that both compilers should bail out at the same line of
code. If the problem occurred at different (random) locations I
would have said you have problems with your RAM. If you fire up
some other (largish) program (like mozilla) and compile again, does
it still die at the same spot?
Cheers,
Tink
|
Same bug with other versions too.. Is this a bug with my other setups? Couldn find the root of this bug..
|
|
|
09-18-2006, 12:03 PM
|
#7
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
Quote:
Yes.. I can compile a C file and generate 32-bit binary. But i need to generate 64-bit binary from which im working on.
|
Well sure, I understand that. I'm asking if you can cross-compile a simple 64 bit binary. What I'm trying to get at is that you should see if it's cross-compiling itself that is breaking gcc or if it is the particular code you are trying...
|
|
|
09-18-2006, 10:21 PM
|
#8
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Original Poster
Rep:
|
Quote:
Originally Posted by bulliver
Well sure, I understand that. I'm asking if you can cross-compile a simple 64 bit binary. What I'm trying to get at is that you should see if it's cross-compiling itself that is breaking gcc or if it is the particular code you are trying...
|
I understand that you are asking me to compile a simple c program to generate 64-bit binary.. Well, if i use the existing gcc to do that
$> gcc -m64 f.c
f.c:1: sorry, unimplemented: 64-bit mode not compiled in
This is the message im getting back..
Am i clear or should give you more details?
|
|
|
09-19-2006, 12:02 AM
|
#9
|
Member
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137
Original Poster
Rep:
|
Hi,
Since the crosstool bug is not solved yet, i tried crosscompiler installation myself. From what i learnt these are the neccessary requirements..
1. Libc headers for the target system.. - linux-libc-headers-2.6.12.0
1. glibc for the target system - got glib-2.3.2
2. binutils - binutils-2.17
While configuring glibc with options
../../decom/glibc-2.3.2/configure --with-binutils=../binutils/bin/ --with-headers=../linux-libc-headers-2.6.12.0/include/asm-x86_64/ --prefix=$PWD --enable-add-ons --build=i686-pc-linux-gnu --host=x86_64-linux-gnu
The output generated is
checking build system type... i686-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking sysdep dirs... sysdeps/x86_64/elf sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking for x86_64-linux-gnu-gcc... no
checking for x86_64-linux-gnu-cc... no
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... Make: gmake
3.80, ok
configure: error:
*** These critical programs are missing or too old: gcc
*** Check the INSTALL file for required versions.
It is checking for x86_64-linux-gnu-gcc which is yet to be installed. Can it compile its code with build system's gcc ( ie: /usr/bin/gcc )?
I tried setting the env CC to /usr/bin/gcc . But still it fails.
Couldn understand the exact problem. Pl help me to solve this.
|
|
|
All times are GMT -5. The time now is 05:15 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
|
|