Issues in building i686 to mips cross compiler
Darrell Bellert
dbellert@boulder.qms.com
Fri Dec 1 08:07:00 GMT 2000
Alexandre Oliva wrote:
>
> > (2) I got three errors while making GCC:
>
> > -B/home/dbellert/Stuff6/Build/mips-ecoff/bin/ -g -O2 ) works... no
> > configure: error: installation or configuration problem: C compiler
> > cannot create executables.
>
> You must build newlib before other target libraries that depend on a
> fully-working C compiler. The easiest way to accomplish this is to
> use the unified tree, as recommended in the Cross GCC FAQ. The hard
> way is to build just `all-gcc', then proceed to building newlib, then
> go back and make `all-target'.
>
So I chose the hard way and modified my install script to look like:
#!/bin/sh
########################################################################################################
#Script to create a cross compiler
#Recommended way to run script:
#install > install.log 2>&1
########################################################################################################
#<<<<<------------------------- VARIABLES
-------------------------->>>>>
############################################
##### VERSIONS OF UTILITIES TO INSTALL #####
############################################
BINUTILS=binutils-2.10.1 # Name of bin-utils directory
GCC=gcc-2.95.2 # Name of gcc directory
NEWLIB=newlib-1.8.2 # Name of newlib directory
GDB=gdb-5.0 # Name of gdb directory
###################################
##### INSTALLATION PARAMETERS #####
###################################
HOST=i686-pc-linux-gnu # Host machine (machine where you are building
the compiler)
TARGET=mips-ecoff # Target machine (machine for which the compiler
will generate code)
PREFIX=/pika/dbellert/MIPS5 # Root directory for compiler
HEADERS=`pwd`/Include # Target machine header files
LIBS=`pwd`/Lib # Target machine libraries
#<<<<<------------------------- PROCEDURE
-------------------------->>>>>
###########################################################
##### THROW IN SOME BLANK SPACE TO DELINEATE SECTIONS #####
###########################################################
delineate(){
echo
echo
echo
echo $1
echo
"<--------------------------------------------------------------------------------->"
echo
echo
echo
}
#################################################
##### REPORT A CONFIGURATION ERROR AND EXIT #####
#################################################
config_err(){
echo
echo
echo "Error configuring $1"
exit
}
########################################
##### REPORT A MAKE ERROR AND EXIT #####
########################################
make_err(){
echo
echo
echo "Error making $1"
exit
}
###############################################
##### PROCEDURE FOR MAKING CROSS COMPILER #####
###############################################
for i in build-binutils build-gcc build-newlib build-gdb
do
if [[ -d $i ]]
then
rm -r $i
fi
mkdir $i
done
cd build-binutils
delineate "CONFIGURING BINUTILS"
../$BINUTILS/configure --host=$HOST --target=$TARGET --prefix=$PREFIX -v
|| config_err BINUTILS
delineate "MAKING BINUTILS"
make all install || make_err BINUTILS
PATH=$PATH:$PREFIX/bin
cd ../build-gcc
delineate "CONFIGURING GCC"
../$GCC/configure --host=$HOST --target=$TARGET --prefix=$PREFIX -v
--with-headers=$HEADERS --with-libs=$LIBS --with-gnu-as --with-gnu-ld
--with-newlib || config_err GCC
delineate "MAKING GCC"
make all-gcc install || make_err GCC
cd ../build-newlib
delineate "CONFIGURING NEWLIB"
../$NEWLIB/configure --host=$HOST --target=$TARGET --prefix=$PREFIX -v
|| config_err NEWLIB
delineate "MAKING NEWLIB"
make all install || make_err NEWLIB
cd ../build-gcc
delineate "FINISHING GCC"
make all-target install || make_err GCC
cd ../build-gdb
delineate "CONFIGURING GDB"
../$GDB/configure --target=$TARGET --prefix=$PREFIX -v || config_err GDB
delineate "MAKING GDB"
make all install || make_err GDB
-----------------------------------------------------------------------------------------------------------------------------
The original errors that I had disappeared with this change, but one new
error was introduced:
----------------------------------------------------------------------------------------------
Configuring in mips-ecoff/libf2c
creating cache ./config.cache
checking if compiler f771 has been built... yes
checking for gcc... /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/
checking whether the C compiler (/pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -g -O2 ) works... yes
checking whether the C compiler (/pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -g -O2 ) is a cross-compiler...
yes
checking whether we are using GNU C... yes
checking whether /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ accepts -g... yes
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... yes
checking how to run the C preprocessor...
/pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -E
checking for stdio.h... yes
checking f2c integer type... configure: error: Can't run check for
integer sizes -- see config.log
Configuring in mips-ecoff/libchill
-------------------------------------------------------------------------------------------------
And the output from config.log:
--------------------------------------------------------------------------------------------------
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:562: checking if compiler f771 has been built
configure:593: checking for gcc
configure:706: checking whether the C compiler
(/pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -g -O2 ) works
configure:722: /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -o conftest -g -O2 conftest.c
1>&5
/pika/dbellert/MIPS5/mips-ecoff/bin/ld: warning: cannot find entry
symbol start; defaulting to a0012000
configure:748: checking whether the C compiler
(/pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -g -O2 ) is a cross-compiler
configure:753: checking whether we are using GNU C
configure:762: /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -E conftest.c
configure:781: checking whether /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ accepts -g
configure:861: checking for a BSD compatible install
configure:914: checking whether make sets ${MAKE}
configure:943: checking how to run the C preprocessor
configure:964: /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -E conftest.c >/dev/null
2>conftest.out
configure:1024: checking for stdio.h
configure:1034: /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -E conftest.c >/dev/null
2>conftest.out
configure:1065: checking f2c integer type
configure:1087: /pika/dbellert/Stuff/build-gcc/gcc/xgcc
-B/pika/dbellert/Stuff/build-gcc/gcc/
-B/pika/dbellert/MIPS5/mips-ecoff/bin/ -c -g -O2 -DHAVE_CONFIG_H
-DIN_GCC -I../../../gcc-2.95.2/libf2c/../gcc/f
-I../../../gcc-2.95.2/libf2c/../gcc
-I../../../gcc-2.95.2/libf2c/../include
-I../../../gcc-2.95.2/libf2c/../gcc/config
-I/pika/dbellert/Stuff/build-gcc/gcc conftest.c 1>&5
In file included from ../../../gcc-2.95.2/libf2c/../gcc/f/system.j:25,
from ../../../gcc-2.95.2/libf2c/../gcc/f/proj.h:32,
from configure:1079:
../../../gcc-2.95.2/libf2c/../gcc/system.h:133: strings.h: No such file
or directory
configure: failed program was:
#line 1078 "configure"
#include "confdefs.h"
#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1
#include "com.h"
int main() {
; return 0; }
---------------------------------------------------------------------------------------------------------------------
I'm guessing that strings.h is a header file for my target machine, is
this correct? If I do not have such a file, then
(1) where can I find one or
(2) what are the impacts of missing this file (again, the build process
completed to the end)?
Thanks to Alexandre Oliva for the prior help!
Darrell
More information about the Gcc-help
mailing list