Subject: Re: gcc g77 and stuff
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: JOZE is great <joze@krisdec2.physik.uni-karlsruhe.de>
List: port-pmax
Date: 05/16/1997 22:09:13
Dear Johathan Stone,

> 
> I'm using the standard NetBSD version of gcc. In the snapshot, that's
> gcc 2.7.2. The NetBSD source tree was updated to 2.7.2.2 yesterday.

yes, but how do I use the source tree, there are some strange makefiles ..

> 
> You *need* to compile all files with -mabicalls. (That's the default
> for the NetBSD/pmax gcc.)

I've tryed this, nothing improved.

> 
> You also need to compile .so files for shared libraries with
> -mhalf-pic.  Again, that's the default for NetBSD/pmax gcc.  (This is
> apparently what OpenBSD does too, and for the same reason: so that if
> you compile foo.c to foo.o, you can link with either static or
> dynamic-shared libraries.)

-mhalf-pic is not supported, says the compiler.

> 
> I'd guess that g77 isn't configured properly for a NetBSD/mips target.
> 
> If you do *all* your g77 compiles with "-mhalf-pic -fpic -mabicalls",
> then you shouldn't have any pro> 

Well, the problem is just to comile the 'plain' gcc first.
I don't know the steps to patch the gcc-2.7.2.2 original distribution.
I got your gcc2netbsd perl script, but don't know, how to use it.

suppose, I've unpacked my gcc-2.7.2.2 in /usr/src. 
So I get the directory
  /usr/src/gcc-2.7.2.2/ 
with all the stuff in it.

If i try to 
  ./configure --build=mips-dec-netbsd 
  make LANGUAGES=c
	make stage1
	...

that will not work. Even here I get the linker problem.
( ld: linking PIC with non-PIC files )
the problem seems to be, that some files are compiled with the ./xgcc -B./
When I hack the Makefile, so that everything is compiled with my original
gcc, I'll get a xgcc wich compiles my small test program 'bla.c', if I use
  ./xgcc -B./ -o bla bla.c

but I get the warning:
	ld: -G switch not supported ..

How can I patch the original distribution ? --
I tryed to use gcc2netbsd and copied the generated files of TARGETDIR
back to the original /usr/src/gcc-2.7.2.2/ directory.
But some paths for includes are not set right then.

To summarize:

  I just want to have the g77, that's all.
  but building g77 without gcc-2.7.2.2 is not possible.

With best regards, Johannes Zellner.