* Issues in building i686 to mips cross compiler
@ 2000-11-30 13:36 Darrell Bellert
2000-11-30 14:03 ` Alexandre Oliva
0 siblings, 1 reply; 3+ messages in thread
From: Darrell Bellert @ 2000-11-30 13:36 UTC (permalink / raw)
To: gcc-help
Hello, I have a couple of concerns in creating a mips-ecoff cross
compiler on RedHat 7.0 that I was hoping someone could address.
First, however, here is the script I used (modeled after section 4.1 of
the FAQ) in order to create the compiler:
-------------------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
########################################################################################################
#Script to create a cross compiler
########################################################################################################
#<<<<<------------------------- 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/MIPS2 # Root directory for compiler
HEADERS=`pwd`/Include # Target machine header files
LIBS=`pwd`/Lib # Target machine libraries
CC=/usr/bin/gcc # A working C compiler
#<<<<<------------------------- 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 #####
###############################################
export CC
PATH=$PATH:$PREFIX/bin
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
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 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-gdb
delineate "CONFIGURING GDB"
../$GDB/configure --target=$TARGET --prefix=$PREFIX -v || config_err GDB
delineate "MAKING GDB"
make all install || make_err GDB
--------------------------------------------------------------------------------------------------------------------------------------------------------
Here are my concerns:
(1) In order for GCC to build correctly, I had to setup the PATH
variable to include $PREFIX/bin. Without doing this, I would get an
error:
/bin/sh: mips-ecoff-ar: command not found
The reason for this concern is that the FAQ does not mention modifying
the PATH variable until you get to NEWLIB. I just wanted to make sure
that modifying my path did not have any adverse effects that are not
obvious. Any thoughts?
(2) I got three errors while making GCC:
make[3]: Entering directory
`/pika/dbellert/Stuff6/build-gcc/mips-ecoff/libstdc++/testsuite'
make[3]: Leaving directory
`/pika/dbellert/Stuff6/build-gcc/mips-ecoff/libstdc++/testsuite'
make[2]: Leaving directory
`/pika/dbellert/Stuff6/build-gcc/mips-ecoff/libstdc++'
make[1]: Leaving directory
`/pika/dbellert/Stuff6/build-gcc/mips-ecoff/libstdc++'
Configuring in mips-ecoff/libf2c
creating cache ./config.cache
checking if compiler f771 has been built... yes
checking for gcc... /home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/
checking whether the C compiler
(/home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
Configuring in mips-ecoff/libchill
creating cache ./config.cache
checking if compiler cc1chill has been built... yes
checking for gcc... /home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/
checking whether the C compiler
(/home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
Configuring in mips-ecoff/libobjc
creating cache ./config.cache
checking if compiler cc1obj has been built... yes
checking for gcc... /home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/
checking whether the C compiler
(/home/dbellert/Stuff6/build-gcc/gcc/xgcc
-B/home/dbellert/Stuff6/build-gcc/gcc/
-B/home/dbellert/Stuff6/Build/mips-ecoff/bin/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
/bin/sh ../gcc-2.95.2/mkinstalldirs /home/dbellert/Stuff6/Build
/home/dbellert/Stuff6/Build
Even though installation ultimately completed, is there any reason for
concern for the above errors (configure: error: installation or
configuration problem: C compiler cannot create executables.)?
(3) I got numerous warnings during the make process (about 4300). Is
this normal or should this also be a cause for concern?
If anyone has any comments for these concerns, please share.
Thanks,
Darrell
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Issues in building i686 to mips cross compiler
2000-11-30 13:36 Issues in building i686 to mips cross compiler Darrell Bellert
@ 2000-11-30 14:03 ` Alexandre Oliva
2000-12-01 8:07 ` Darrell Bellert
0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Oliva @ 2000-11-30 14:03 UTC (permalink / raw)
To: Darrell Bellert; +Cc: gcc-help
On Nov 30, 2000, Darrell Bellert <dbellert@boulder.qms.com> wrote:
> The reason for this concern is that the FAQ does not mention modifying
> the PATH variable until you get to NEWLIB. I just wanted to make sure
> that modifying my path did not have any adverse effects that are not
> obvious. Any thoughts?
It doesn't have any adverse effects and, indeed, it is necessary.
> (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'.
> Even though installation ultimately completed, is there any reason for
> concern for the above errors (configure: error: installation or
> configuration problem: C compiler cannot create executables.)?
Only if you want support for languages other than C.
> (3) I got numerous warnings during the make process (about 4300). Is
> this normal or should this also be a cause for concern?
It's normal.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Issues in building i686 to mips cross compiler
2000-11-30 14:03 ` Alexandre Oliva
@ 2000-12-01 8:07 ` Darrell Bellert
0 siblings, 0 replies; 3+ messages in thread
From: Darrell Bellert @ 2000-12-01 8:07 UTC (permalink / raw)
To: gcc-help
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-12-01 8:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-30 13:36 Issues in building i686 to mips cross compiler Darrell Bellert
2000-11-30 14:03 ` Alexandre Oliva
2000-12-01 8:07 ` Darrell Bellert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).