LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 09-15-2006, 02:12 AM   #1
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Rep: Reputation: 15
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..
 
Old 09-16-2006, 02:17 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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?
 
Old 09-16-2006, 03:04 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 09-17-2006, 04:29 AM   #4
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
hi,
Im on leave today. Will check it and post tommorrow..

Thanks
Gk
 
Old 09-18-2006, 05:10 AM   #5
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
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..
 
Old 09-18-2006, 05:11 AM   #6
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
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..
 
Old 09-18-2006, 12:03 PM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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...
 
Old 09-18-2006, 10:21 PM   #8
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
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?
 
Old 09-19-2006, 12:02 AM   #9
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitor bandwidth usage and attempted usage! Depressed_amphibian Linux - Networking 3 06-15-2006 07:13 AM
Memory Usage Spaw Usage Swappiness Issues joelunch Linux - Software 3 01-04-2006 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration