[comp.os.minix] gcc under MacMinix?

tonyg@cs.uq.oz.au (Tony Gedge) (04/20/91)

I've just ftp'ed the gcc binaries for ST-Minix from plains.nodak.edu.
(i.e. the pub/Minix/uk/mincen/68k/gcc ones) and I've been massaging
them to work properly under MacMinix.

Should I be using the gccXXX.tar.Z files in pub/Minix/uk instead of those
in pub/Minix/uk/mincen/68k/gcc?  Which is better?

After unpacking the binaries and applying the lib and includes patches, I had
to make a few modifications to get gcc producing useable executables:
  1) modify crtso.cpp to include the Mac specific stuff (setup of saveda5 and
	 savedsp)
  2) Some minor modifications to head.s (not important for non-kernel stuff)
  3) Converting the ACK assembler glue code in /usr/src/lib/mac/libmac into
	 MIT syntax.

After these mods were made, I could use gcc to recompile Minix programs which
all ran without difficulty.  I tested my new libmac library glue code and it
appears to be working correctly.

Now the big problem:

I can recompile and link fs and mm without trouble (I'm not worrying about
padding of bss et al just yet!) however the kernel is giving me trouble.  I
can recompile all the sources, however gcc-ld will not link them to produce
the final object.  Make abouts with error code 256, and gcc-ld gives no
error messages about why it couldn't link.  I chmem'ed gcc-ld up to 2Meg and
used 'make -n > mk; sh mk' but got the same message.

The Questions:

Has anyone else rebuilt the MacMinix boot application with gcc?
Can someone give me some leads about how I might approach finding the problem?
What other things will I have to do before I can rebuild the kernel (padding
etc.)?  I'm going to try rebuilding gcc-ld with some 'debugging statments'
so I can find out where it is going wrong.

Thanks in advance,

Tony Gedge.

--
 -------------------------------------------------------------------------
| Computer Science Department,        | tonyg@cs.uq.oz.au   (Tony Gedge)  |
| University of Queensland, Australia.| "cc stands for Cryptic Crossword" |
 -------------------------------------------------------------------------

eesrajm@cc.brunel.ac.uk (Andrew J Michael) (04/26/91)

In article <918@uqcspe.cs.uq.oz.au>, tonyg@cs.uq.oz.au (Tony Gedge) writes:
> I've just ftp'ed the gcc binaries for ST-Minix from plains.nodak.edu.
> (i.e. the pub/Minix/uk/mincen/68k/gcc ones) and I've been massaging
> them to work properly under MacMinix.
> 
> Should I be using the gccXXX.tar.Z files in pub/Minix/uk instead of those
> in pub/Minix/uk/mincen/68k/gcc?  Which is better?
> 

I'm not sure about better, but I think that you'll find that the version in
pub/Minix/uk is for MINIX/386, not MINIX/68k.  Yes I know that it is
confusing; it's just that both myself and Alan Black (who did the 386 port)
come from the UK ....


(Other details deleted)
> 
> Now the big problem:
> 
> I can recompile and link fs and mm without trouble (I'm not worrying about
> padding of bss et al just yet!) however the kernel is giving me trouble.  I
> can recompile all the sources, however gcc-ld will not link them to produce
> the final object.  Make abouts with error code 256, and gcc-ld gives no
> error messages about why it couldn't link.  I chmem'ed gcc-ld up to 2Meg and
> used 'make -n > mk; sh mk' but got the same message.
> 

(Other things deleted)

> 
> Thanks in advance,
> 
> Tony Gedge.


This is one of gcc-ld's nastier features; I don't know if it just applies to
this port, but if it cannot reconcile a label, most of the time it will tell
you so - but sometimes it just blows up with out saying why.  This sounds like
your problem particularly if you have just modified mpx.s.  Check very
carefully that you havn't got a missing or undefined label somewhere.

Andy Michael



-- 
Andy Michael                                     "You might think that.  I
85 Hawthorne Crescent                             couldn't possibly comment."
West Drayton					    - `House of Cards'
Middlesex            email: eesrajm@brunel.ac.uk                             
UB7 9PA           or Andrew.Michael@brunel.ac.uk

tonyg@cs.uq.oz.au (Tony Gedge) (04/27/91)

In <2089@Terra.cc.brunel.ac.uk> eesrajm@cc.brunel.ac.uk (Andrew J Michael) writes:
>This is one of gcc-ld's nastier features; I don't know if it just applies to
>this port, but if it cannot reconcile a label, most of the time it will tell
>you so - but sometimes it just blows up with out saying why.  This sounds like
>your problem particularly if you have just modified mpx.s.  Check very
>carefully that you havn't got a missing or undefined label somewhere.

And sure enough, Andy was right.  I found that in my porting of ACK as ->
GNU as format I'd hadn't translated references of (a1) to a1@().  gas produced
a undefined symbol, which ld wasn't telling me about.

Also, where are the patches for GNU ld?  I have the binary for GNU ld under
68k Minix and source for stock GNU ld, but no patches.

Tony Gedge.

--
 -------------------------------------------------------------------------
| Computer Science Department,        | tonyg@cs.uq.oz.au   (Tony Gedge)  |
| University of Queensland, Australia.| "cc stands for Cryptic Crossword" |
 -------------------------------------------------------------------------