Building a Fortran Cross Compiler with Gcc-2.95.3

Jim Wilson wilson@specifixinc.com
Sat Feb 28 13:00:00 GMT 2004


aaronchiles@cox.net wrote:
> After its configures I edit /opt/src/xcomp/binutils-2.14/gas/as.c adding line 38
> 38 #define BFD_VERSION_STRING "2.14"

This should not be necessary.  BFD_VERSION_STRING comes from 
bfd/bfdver.h.  Why did you add this?

>(I chose not to create a build directory because I get the same results and felt I might as well leave it all in the same directory)

In general, it really is better to create the separate build directory, 
even if configuring in the source directory seems to work.  You might 
run into differences later.

> CFLAGS = -g 02 -DCPU=PPC604

This is needed only if the powerpc-vxworks target in gcc-2.95 is broken, 
so this is a bad sign.

Adding this to CFLAGS_FOR_TARGET is better than adding it to CFLAGS. 
You only need the CPU macro defined when compiling stuff for the vxworks 
target.

gcc-2.95 incidentally is pretty old by our standardards.  The vxworks 
stuff was poorly maintained for a long time, so you might have problems 
with it.  The vxworks support has recently been rewritten, and the 
ppc-vxworks support on the gcc-3.4 branch looks like it might work.  I 
don't think anything before that will work properly without help.

> Then I type ‘make’ and it begins to build.   After its stop I then type ‘make install’ and it finishes but I believed stopped in the middle.

We shouldn't be trying to build anything at make install time.  Maybe 
the initial "make" failed and you didn't notice?

> checking how to run C preprocessor… /opt/src/gcc-2.95.3/gcc/xgcc –B/usr/include/sys/ 
> 	-B/opt/src/xcomp/gcc-2.95.3/gcc/ -B/opt/src/xcomp/target/powerpc-wrs-vxworks/bin/ -E
> checking for stdio.hÂ… no
> configure: error: CanÂ’t find stdio.h.
> You mus have a usable C system for the target already installed,

You should have a usable C compiler at this point.  This could be a 
general vxworks problem, i.e. the vxworks configure support is broken. 
If you look in the config.log file, you can see the commands that 
configure ran.  It might be trying to link an executable, but you can't 
do that for a vxworks target, you can only generate partially linked 
objects.  If so, then this is likely fixed in current sources.

> I ‘cd’ to /gcc/ and try to ‘make install’ there.

Easier is to do "make install-gcc" from the top level.  You can also do 
"make all-gcc" from the top level.

> make[2]: Entering directory ‘/opt/src/xcomp/gcc-2.95.3/gcc’
> ./xgcc –B/ opt/src/xcomp/target/powerpc-wrs-vxworks/bin/ -B./ -I/ opt/src/xcomp/target/powerpc-wrs-vxworks/include –DCROSS_COMPILE –DHAIFA –DSVR4 –g –I./include –I. –I. –I./config –I./../include –mrelocatable-lib –mno-eabi –mstrict-align –c ecrti.S –o tecrit.o
> make[2]: Leaving directory ‘/opt/src/xcomp/gcc-2.95.3/gcc’
> mv: cannot access tecrti.o

There must have been some kind of build error that you didn't report. 
make install can't find tecrti.o probably because it didn't build.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list