cross compiling for x86_64

Indu Bhagat bhagat.indu@gmail.com
Sat Jan 6 21:26:00 GMT 2007


Hi,

 I am trying to configure gcc for compiling some c,cpp and fortran
sources to x86_64 on my x86 machine using the following steps:


 1. Binutils-2.17 configuration and installation:
$../binutils-2.17/configure --target=x86_64-pc-linux
--prefix=/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/
 $ ...
 $ make all install

  2. After successful completion of step 1, gcc configuration and installation:

$ export PATH=$PATH:/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/bin/
 $ ../gcc-4.1.1/configure --target=x86_64-pc-linux
--prefix=/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/
--disable-shared --disable-threads --enable-tls --enable-languages=c
--with-newlib
 $ make all-gcc
 $ make install-gcc

  3. After this, I proceeded with glibc, as I think one needs to have
appropriate library support as well, to support cross compilation. So,
I cnfigured and installed the glibc-2.5

$ ../glibc-2.5/configure
--prefix=/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/
--host=x86_64-pc-linux --build=i686-redhat-linux
--enable-add-ons=linuxthreads --disable-sanity-checks
--with-headers=/users/scratch/ibhagat/x86_64-exp/linux-2.6.19.1/include
--with-tls --with-__thread
--with-binutils=/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/bin/
 $ make all install

 4. Till step 3 it works fine, and now I can generate x86_64
executables using gcc. But moving further, i need g++ and gfortran as
well. To build these i used the same command as before (the PATH
remaining the same)-

$ ../gcc-4.1.1/configure --target=x86_64-pc-linux
--prefix=/users/scratch/ibhagat/x86_64-exp/x86_64_prefix-II/
--disable-shared --disable-threads --enable-tls --enable-languages=c++

 I get the following error :

 checking float.h usability... no
 checking float.h presence... yes
 configure: WARNING: float.h: present but cannot be compiled
 configure: WARNING: float.h:     check for missing prerequisite headers?
 configure: WARNING: float.h: see the Autoconf documentation
 configure: WARNING: float.h:     section "Present But Cannot Be Compiled"
 configure: WARNING: float.h: proceeding with the preprocessor's result
 configure: WARNING: float.h: in the future, the compiler will take precedence
 configure: WARNING:     ## ----------------------------------------- ##
 configure: WARNING:     ## Report this to the package-unused lists.  ##
 configure: WARNING:     ## ----------------------------------------- ##
 checking for float.h... yes
 checking for endian.h... (cached) no
 checking for inttypes.h... (cached) no
 checking locale.h usability... no
 checking locale.h presence... no
 checking for locale.h... no
 checking for float.h... (cached) yes
 checking for stdint.h... (cached) no
 checking for ld that supports -Wl,-z,relro... yes
 checking for main in -lm... configure: error: Link tests are not
allowed after GCC_NO_EXECUTABLES.
 make[1]: *** [configure-target-libstdc++-v3] Error 1
 make[1]: Leaving directory `/users/scratch/ibhagat/x86_64-exp/gcc-4.1-build-II'
 make: *** [all] Error 2

 So, it doesnt work for me. Can somebody help me out here? I am not
able to build g++, and gfortran to cross-compile for x86_64. I am
attaching the config.log from x86_64-pc-linux/libstdc++-v3/ directory.

 Thanks in advance,
 Indu Bhagat



More information about the Gcc-help mailing list