public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building a Fortran Cross Compiler with Gcc-2.95.3
@ 2004-02-27 15:43 aaronchiles
  2004-02-27 16:29 ` Andrew Haley
  2004-02-28 16:06 ` Jim Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: aaronchiles @ 2004-02-27 15:43 UTC (permalink / raw)
  To: gcc-help, gcc

I having problems building a fortran cross compiler.  I've tried several different versions, configuration, etc. and I'm not having any luck.  Most want to know what my procedure is before they can diagnose my problem so I'll just go though the procees.  First I download gcc-2.95.3 and binutils02.14 and make an empty target directory all in the same level for this it will be /opt/src/xcomp/.

Next I configure the binutilites with the following configuration typing: configure --host=sparc-sun-solaris2.9 --target=powerpc-wrs-vxworks --with-headers=/opt/wind/target/h --with-libs=/opt/wind/target/lib --prefix=/opt/src/xcomp/target --enable-threads=vxworks

After its configures I edit /opt/src/xcomp/binutils-2.14/gas/as.c adding line 38
37 #define COMMON
38 #define BFD_VERSION_STRING "2.14"
39
40 #include "as.h"

I type 'make' and then 'make install'.  And it install the assembler, loader, etc.

Then I 'cd' to /opt/src/xcomp/gcc-2.95.3 to configure the gcc.  (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)  For the gcc configuration I give the following command at the prompt.  
/opt/src/xcomp/gcc-2.95.3> configure --host=sparc-sun-solaris2.9 --target=powerpc-wrs-vxworks --with-headers=/opt/wind/target/h --with-libs=/opt/wind/target/lib --prefix=/opt/src/xcomp/target --enable-threads=vxworks --enable-languages=f77

When the configure finishes I edit the Makefile to such that its add a flag to the CFLAGS.  
CFLAGS = -g 02 -DCPU=PPC604

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.  I scroll up and find a message that:

checking for a BSD compatible install… ../../install-sh –c
checking whether make sets ${MAKE}… yes
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, at least including headers and, preferably, the library, before you can configure the G77 runtime system. If necessary install gcc now with ‘LANGUAGES=c’ then the target library, then build with “LANGUAGES=f77”. 

I’ve tried configuring with out enabling f77 and it seems the C will not install.
I ‘cd’ to /gcc/ and try to ‘make install’ there. It seems to build ok but I don’t know if it installed fine…so I do a ‘make –n install LANGUAGES =c’.   

I receive the following set of errors:

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
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
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
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
make[1]: *** [stmp-multilib-sub] Error2
make[1]: Leaving directory ‘/opt/src/xcomp/gcc-2.95.3/gcc’
make: *** [stmp-multilib] Error 1

I think if I can get past this I may be able to accomplish building the Fortran cross compiler.  Anyone have any Ideas…


Regards,


	Aaron Chiles
	WR-ALC/MASFE Bldg 227
	478.926.1370 / DSN 468.1370
	Aaron.Chiles@Robins.AF.MIL 

	Psalms 143 ~
	10 Teach me to do thy will; for thou art my God: thy spirit is good; lead me into the land of uprightness. 11 Quicken me, O LORD, for the name's sake: for thy righteousness' sake bring my soul out of trouble.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Building a Fortran Cross Compiler with Gcc-2.95.3
  2004-02-27 15:43 Building a Fortran Cross Compiler with Gcc-2.95.3 aaronchiles
@ 2004-02-27 16:29 ` Andrew Haley
  2004-02-28 16:06 ` Jim Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Haley @ 2004-02-27 16:29 UTC (permalink / raw)
  To: aaronchiles; +Cc: gcc-help

aaronchiles@cox.net writes:
 > I having problems building a fortran cross compiler.  I've tried
 > several different versions, configuration, etc. and I'm not having any
 > luck.  Most want to know what my procedure is before they can diagnose
 > my problem so I'll just go though the procees.  First I download
 > gcc-2.95.3 and binutils02.14 and make an empty target directory all in
 > the same level for this it will be /opt/src/xcomp/.
 > 
 > Next I configure the binutilites with the following configuration
 > typing: configure --host=sparc-sun-solaris2.9
 > --target=powerpc-wrs-vxworks --with-headers=/opt/wind/target/h
 > --with-libs=/opt/wind/target/lib --prefix=/opt/src/xcomp/target
 > --enable-threads=vxworks
 > 
 > After its configures I edit /opt/src/xcomp/binutils-2.14/gas/as.c adding line 38
 > 37 #define COMMON
 > 38 #define BFD_VERSION_STRING "2.14"
 > 39
 > 40 #include "as.h"
 > 
 > I type 'make' and then 'make install'.  And it install the assembler, loader, etc.
 > 
 > Then I 'cd' to /opt/src/xcomp/gcc-2.95.3 to configure the gcc.  (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) For the
 > gcc configuration I give the following command at the prompt.
 > /opt/src/xcomp/gcc-2.95.3> configure --host=sparc-sun-solaris2.9 --target=powerpc-wrs-vxworks --with-headers=/opt/wind/target/h --with-libs=/opt/wind/target/lib --prefix=/opt/src/xcomp/target --enable-threads=vxworks --enable-languages=f77
 > 
 > When the configure finishes I edit the Makefile to such that its add a flag to the CFLAGS.  
 > CFLAGS = -g 02 -DCPU=PPC604
 > 
 > 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.  I scroll up and find a message that:
 > 
 > checking for a BSD compatible install… ../../install-sh –c
 > checking whether make sets ${MAKE}Â… yes
 > 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 must have a usable C system for the target already installed, at
 > least including headers and, preferably, the library, before you can
 > configure the G77 runtime system. If necessary install gcc now with
 > LANGUAGES=cÂ’ then the target library, then build with
 > LANGUAGES=f77”.

Well, this is your problem.  The cross compiler, for some reason,
isn't finding your target headers.  

It's been such a long time since I used gcc 2.95 that I can't
understand why this might be.

Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building a Fortran Cross Compiler with Gcc-2.95.3
  2004-02-27 15:43 Building a Fortran Cross Compiler with Gcc-2.95.3 aaronchiles
  2004-02-27 16:29 ` Andrew Haley
@ 2004-02-28 16:06 ` Jim Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Wilson @ 2004-02-28 16:06 UTC (permalink / raw)
  To: aaronchiles; +Cc: gcc-help, gcc

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-28  2:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27 15:43 Building a Fortran Cross Compiler with Gcc-2.95.3 aaronchiles
2004-02-27 16:29 ` Andrew Haley
2004-02-28 16:06 ` Jim Wilson

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).