OSDev.org

The Place to Start for Operating System Developers
It is currently Mon May 06, 2024 7:20 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GCC Cross-Compiler Installation
PostPosted: Fri Apr 24, 2015 2:02 pm 
Offline

Joined: Fri Apr 24, 2015 1:25 pm
Posts: 14
Hi,
I recently started learning about operating system. When I got to learn about the basics, I reached here on http://wiki.osdev.org/GCC_Cross-Compiler
Now I am stuck at GCC Cross-Compiler Installation.

I downloaded these packages
1)binutils-2.25.tar.gz
2)cloog-parma-0.16.1.tar.gz
3)gcc-4.9.2.tar.gz
4) gmp-6.0.0a.tar.lz
5)isl-0.12.2.tar.gz
6)mpc-1.0.3.tar.gz
7)mpfr-3.1.2.tar.gz

and I followed these instruction on by Ubuntu 14.04 with pre installed gcc version 4.8.2

Preparation
Code:
export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"


binutils
Code:
# If you wish to build these packages as part of binutils:
mv isl-x.y.z binutils-x.y.z/isl
mv cloog-x.y.z binutils-x.y.z/cloog
# But reconsider: You should just get the development packages from your OS.


Code:
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install



GCC
Code:
cd $HOME/src
# If you wish to build these packages as part of gcc:
mv libiconv-x.y.z gcc-x.y.z/libiconv # Mac OS X users
mv gmp-x.y.z gcc-x.y.z/gmp
mv mpfr-x.y.z gcc-x.y.z/mpfr
mv mpc-x.y.z gcc-x.y.z/mpc
mv isl-x.y.z gcc-x.y.z/isl
mv cloog-x.y.z gcc-x.y.z/cloog
# But reconsider: You should just get the development packages from your OS.
mkdir build-gcc
cd build-gcc
../gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc
make all-target-libgcc


then error appears:

Code:
checking for suffix of object files... configure: error: in `/home/coder/src/build-gcc/i686-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make: *** [configure-target-libgcc] Error 1


because of these further steps are failing.

How shall I proceed?

I have attached the config.log file.


Attachments:
File comment: Config.log file
config.log.txt [10.58 KiB]
Downloaded 28 times
Top
 Profile  
 
 Post subject: Re: GCC Cross-Compiler Installation
PostPosted: Fri Apr 24, 2015 3:25 pm 
Offline
Member
Member

Joined: Tue Jan 20, 2015 8:33 pm
Posts: 29
This can be caused by messing up your GMP/MPFR/MPC installation, I had this problem for a few hours just last weekend :)

Try:

1. Delete your build-binutils and build-gcc directories - I found that once I hit this point, 'make clean distclean' could no longer fix it.
2. Remake your build-binutils and build-gcc directories.
3. Change directory to the gcc directory (NOT the build-gcc directory).
4. Run ./contrib/download_prerequisites (this will get the correct versions of GMP, MPFR and MPC downloaded into your gcc tree, instead of using your system libraries)
5. Change directory to build-binutils
6. Now you should be able to follow the tutorial as written, except for the part where you put the GMP/MPFR/MPC/ISL/CLOOG libraries in the GCC directory.

I don't know why the tutorial suggests downloading the supporting libraries separately and copying them into the gcc directory, but that never worked for me (and cost me a few hours) - the ./contrib/download_prerequisites script handles doing that for you, with the correct versions guaranteed.

e: looking at your config.log file I can see you're having the literal exact same problem as I was (as: exec: -o: not found) - hopefully this saves you the three or four hours of pain I went through :P


Top
 Profile  
 
 Post subject: Re: GCC Cross-Compiler Installation
PostPosted: Fri Apr 24, 2015 11:12 pm 
Offline

Joined: Fri Apr 24, 2015 1:25 pm
Posts: 14
Still the same error throws.
Which version of gcc and binutils did you download?


Top
 Profile  
 
 Post subject: Re: GCC Cross-Compiler Installation
PostPosted: Sat Apr 25, 2015 12:21 am 
Offline
Member
Member

Joined: Tue Jan 20, 2015 8:33 pm
Posts: 29
I have both a 32-bit and 64-bit cross compiler running with binutils 2.24 and gcc 4.9.2.

Are you sure your binutils has been built properly? Try running
Code:
$PREFIX/bin/i686-elf-as --version


Top
 Profile  
 
 Post subject: Re: GCC Cross-Compiler Installation
PostPosted: Sat Apr 25, 2015 12:45 am 
Offline

Joined: Fri Apr 24, 2015 1:25 pm
Posts: 14
I hadn't installed textinfo. Now everything works fine :) ty for ur help :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Amazonbot [bot], Bing [Bot] and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group