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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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 ? ?
.....
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:
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.
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.
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.
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.
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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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.
.....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.