LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 11-01-2009, 07:20 AM   #1
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Rep: Reputation: 0
binutils installation help


hello ,

i am trying to install a cross developement toolchain for arm.
found a script that will install the tool chain.

from the script

Code:
./configure --target=arm-linux --prefix=/usr/local

make
make install

i got this:
see file attached..
Attached Files
File Type: txt output.txt (167.8 KB, 17 views)

Last edited by sanatan1988; 11-01-2009 at 07:22 AM.
 
Old 11-01-2009, 08:21 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
About your ' output.txt ' : Sorry , but looks all wrong.

1) Installing binutils, etc. to /usr/local/ can (may be)
disturb your system. Cross tools must be installed to a
non system path, like /usr/local/cross/ or /opt/arm-cross/.

2) The directory /root/ is not supposed to be used for build.
/root/ shouldn't be used for anything ... never.

The default build directory is /home/'user'/tmp/ .
But you can of course use any foldername in /home/'user'/ .

3) If you want to build a tool chain manually, binutils
version 2.20 may not be the best choice.
And the build folder may be missing.
.. Also : Wrong configure options ? ?
.....

The best way to learn to build a system or cross tools,
usually is to start with LFS, Linux From Scratch ,
and later move on to CLFS, Cross Linux From Scratch.
http://www.linuxfromscratch.org/lfs/view/6.5/
http://trac.cross-lfs.org/

First time Binutils example here :
http://www.linuxfromscratch.org/lfs/...ils-pass1.html
Please see, that the build folder is created to be
outside binutils-2.xx/
.
http://www.linuxfromscratch.org/lfs/.../binutils.html
.....
.....
Cross tools, available : It has been said that the only
supported and maintained is ' crosstools-ng '
http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
.. Last update two days ago ! ...
.....

Last edited by knudfl; 11-01-2009 at 10:57 AM.
 
Old 11-03-2009, 01:01 AM   #3
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
hello knudfl..

sorry for the late reply..

first thanks..

i have followed all the steps u have mentioned. still after that ,the same problem.i wondered if i messed up my OS .So i reinstalled my OS (ubuntu 9.04 Jaunty ). I have installed all the necessaries i.e:

make,gcc,file,flex,bison,patch,libc6-dev,perl,bzip2,wget,libncurses5-dev,telnet,texinfo.

i am using the script from http://embeddedlinuxinterfacing.com/...uildtoolchain/
downloaded buildtoolchain.tar.gz
i modified the builtoolchain-environment script:

export SRCFILELOC=/home/sanatan/cross
export BUILDLOC=/home/sanatan/cross/builds
export PREFIX=/usr/local/toolchain
export BTVERSION=v1.21

then when i run .. i get the same problem..

if u can observe.. at some place, its like:
Code:
 
updating cache ../config.cache
creating ./config.status
creating Makefile
creating doc/Makefile
creating .gdbinit
creating po/Makefile.in
creating config.h
Configuring etc...
loading cache ../config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
creating ./config.status
creating Makefile
make[1]: Entering directory `/home/sanatan/cross/builds/arm-linux-binutils/libiberty'
if [ x"" != x ] && [ ! -d pic ]; then \
	  mkdir pic; \
	else true; fi
touch stamp-picdir
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/argv.c -o pic/argv.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/argv.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/choose-temp.c -o pic/choose-temp.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/choose-temp.c
../../binutils-2.11.2/libiberty/choose-temp.c: In function ‘choose_temp_base’:
../../binutils-2.11.2/libiberty/choose-temp.c:140: warning: ignoring return value of ‘mktemp’, declared with attribute warn_unused_result
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/concat.c -o pic/concat.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/concat.c
../../binutils-2.11.2/libiberty/concat.c: In function ‘concat’:
../../binutils-2.11.2/libiberty/concat.c:83: warning: traditional C rejects ISO C style function definitions
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/cplus-dem.c -o pic/cplus-dem.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/cplus-dem.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/cp-demangle.c -o pic/cp-demangle.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/cp-demangle.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/dyn-string.c -o pic/dyn-string.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/dyn-string.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/fdmatch.c -o pic/fdmatch.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/fdmatch.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/fnmatch.c -o pic/fnmatch.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/fnmatch.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/getopt.c -o pic/getopt.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/getopt.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/getopt1.c -o pic/getopt1.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/getopt1.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic  ../../binutils-2.11.2/libiberty/getpwd.c -o pic/getpwd.o; \
	else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W -Wall -Wtraditional -pedantic ../../binutils-2.11.2/libiberty/getpwd.c
if [ x"" != x ]; then \
	  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.11.2/libiberty/../include  -W
i dont understand, even after a fresh install what could be wrong. could it be the script.i am guessing the probability the script to be wrong is very less. i googled may sites, and found out that the procedure is similar.

i have been trying for the past one week (non stop). to set up a tool chain for arm.

now i am ready to try again. i will again make a fresh install of ubuntu 9.04. please tell me now how to install a cross toolchain.

thanks in advance..
 
Old 11-03-2009, 01:16 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You need to remove what you installed at first under /usr/local -it gets found first in your path and won't let the normal tools under /usr work.
 
Old 11-03-2009, 01:49 AM   #5
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
You need to remove what you installed at first under /usr/local -it gets found first in your path and won't let the normal tools under /usr work.
__________________
well now i have a fresh ubuntu 9.04 there is nothing there in /usr/local

@ gnashley

normal tools at /usr .. why? i am not trying to remove the crosstools completly .. i am trying to build a cross tool for arm.

now since i have fresh ubuntu .. should i worry about the above.


thanks
 
Old 11-03-2009, 02:39 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You need for the normal compiler, binutils to work so that you can produce a crsoo compiler. You should not install the cross-tools to /usr/local because they will be seen in your normal path. For cross-tools always use a path like /usr/local/something or /usr/something so that the crosstools never interfere with normal compiler and Co.
 
Old 11-03-2009, 02:43 AM   #7
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
yes i have a path called:

prefix =/usr/local/crosstool/
 
Old 11-03-2009, 09:59 AM   #8
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
guess no one has installed crosstools in ubuntu..
 
Old 11-03-2009, 10:28 AM   #9
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
guess no one installs cross tool in ubuntu,
 
Old 11-03-2009, 10:39 AM   #10
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by sanatan1988 View Post
then when i run .. i get the same problem..

if u can observe.. at some place, its like:
You haven't shown any errors.
 
Old 11-03-2009, 11:03 AM   #11
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
i have attached a file see top..

please help..
 
Old 11-03-2009, 11:34 AM   #12
sanatan1988
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Original Poster
Rep: Reputation: 0
just curious how would a successful installation look like.
 
Old 11-03-2009, 12:48 PM   #13
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
EDIT: I think gnashley's and knudfl's advice is better.

I can't say that I have any experience with building binutils, but looking at the error:

Code:
make[3]: Entering directory `/root/cross/builds/arm-linux-binutils/gas'
gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.20/gas  -I. -I../../binutils-2.20/gas -I../bfd -I../../binutils-2.20/gas/config -I../../binutils-2.20/gas/../include -I../../binutils-2.20/gas/.. -I../../binutils-2.20/gas/../bfd -DLOCALEDIR="\"/usr/local/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -MT tc-arm.o -MD -MP -MF .deps/tc-arm.Tpo -c -o tc-arm.o `test -f 'config/tc-arm.c' || echo '../../binutils-2.20/gas/'`config/tc-arm.c
cc1: warnings being treated as errors
../../binutils-2.20/gas/config/tc-arm.c: In function ‘make_mapping_symbol’:
../../binutils-2.20/gas/config/tc-arm.c:2489: error: suggest braces around empty body in an ‘if’ statement
Warnings being treated as errors seems like a bad idea unless you're a binutils developer. So see if you can drop the -Werror flag, or else add braces on line 2489 I guess.

Last edited by ntubski; 11-04-2009 at 09:20 AM.
 
Old 11-03-2009, 12:49 PM   #14
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
This seems to be where it stops:
binutils-2.20/gas/config/tc-arm.c:2489: error: suggest braces around empty body

As someone already suggested, when you want to build a crosstool chain you should never just try the latest release of any of the tools or glibc. In fact for building a normal toolchain you should never do that -it simply will never work.
For crosstool chains you should use combinations of tools and glibc which have been proven to work -that people have done the necessary work on to get them to play nice. Any of the arm-linux projects can provide that guide for you -just use the same versions they are using. Many times you will need to use a few (or a bunch) of patches which add to or fix the capability for the arch you are trying to build.
I recommend using crosstool-ng as it is up-to-date, has support for many arches and is actively developed.
 
Old 11-04-2009, 07:36 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
This may repeat what @gnashley said,
.... and some other comments also said before :

Do not rely on a script dated year 2002 to build
tools from packages released October 2009.
Building e.g. binutils today is (very) different
from seven years ago.

Please read post # 2 , 14 again and consider crosstools-ng !

Binutils 2.20 is quite new and not used in any stable OS.
AFAIK only Debian Sid uses it for "unstable test".
Upcoming releases like Fedora 12 : binutils-2.19.51 .
Which means : patches for bugfixing : Debian Sid only.

Conclusion : Use crosstools-ng + stable packages.
And if you really want to know how things are working
together, spend some months building LFS and next CLFS.
.....
And when you come to know how everything fits together
and why, you will also know how to use the cross tools
to cross compile libraries and applications.
.. And I guess, that's the whole idea about having the tools .. ..
.....
Good luck.
.....

Last edited by knudfl; 11-04-2009 at 07:56 AM.
 
  


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
nvidia display drivers installation error with binutils, binutils allready installed mandrakeBren Linux - Newbie 9 01-06-2009 12:52 PM
5.3.1. Installation of Binutils hemi_426 Linux From Scratch 0 05-06-2008 01:41 PM
Installation of Binutils(configure:error:installation or configuration problem:C ...) h_r0019 Linux From Scratch 1 05-05-2007 07:40 AM
5.3.1 Installation of Binutils microsoft/linux Linux From Scratch 8 10-22-2005 12:41 PM
Installation of binutils....can't mkdir...../binutils-build hmonster Linux From Scratch 6 08-22-2004 04:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 PM.

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