Subject: Re: PTL2 on mips
To: Simon Burge <simonb@netbsd.org>
From: None <k-abe@kuroneko.media.osaka-cu.ac.jp>
List: tech-pkg
Date: 09/14/1999 13:35:21
Hi, folks.
I am Kota Abe, developer of ptl2.  

simon> First - when configure guesses GCC_STDINCLUDE, it looks for the
simon> files included when including <stdarg.h>.  On a mips system,
simon> <machine/stdarg.h> includes <mips/stdarg.h>, and GCC_STDINCLUDE gets set
simon> to "/usr/include\n/usr/include/mips" and this buggers up sed expressions
simon> further on.  I've fixed this by changing the line in configure.in from:
simon> 
simon> 	gcc -E ... | grep '# 1 .*stdarg.h' | sed -e 's@^.*"\(.*\)/stdarg\.h".*$@\1@'
simon> to
simon> 	gcc -E ... | grep '# 1 .*stdarg.h' | sed -e 's@^.*"\(.*\)/stdarg\.h".*$@\1@;q'
simon> 
simon> Note the ';q' at the end of the sed expression.  No problems anyone can
simon> see with this?

I'll incorporate this fix to next ptl2 release...

simon> Second - sometimes ptl2 thinks it's on a "mips-dec-netbsd1.4K", others
simon> a "pmax-unknown-netbsd1.4K" and get's right royally confused when
simon> looking for files.  To get started, I just changed "mips-dec" in various
simon> config.* files to "pmax-unknown", but I'm guessing that it should
simon> be "mipsel-unknown" and "mipseb-unknown".  If so, do I just treak
simon> config.guess to output this?

Maybe config.guess of ptl2 is not the latest version.  Although I'm
not sure if the problem will be solved with updating config.guess, but
I think it is worth trying.

simon> I've now got something that compiles, but doesn't work, and no obvious
simon> ideas jump out at me.  Any mips people wanna take a look at what I have
simon> so far?

Some possible reasons are,

* ld.so may have a bug to initialize shared library (by calling _init).
  ktrace will help you to determine whether the problem is due to this 
  reason or not.  (Or, try to link static library, libPTL.a)

* the mips assembler code embedded in src/jump.c may have a problem.
  (I have never tested the assembler code on NetBSD-mips boxes.
   I know that a very early version of ptl2 had worked on Ultrix.)
  please try to change src/jump.c to use sigstack() (#define
  USE_SIGSTACK) in order to set stack pointer value.

--
Kota Abe
Media Center, Osaka City Univ.