Subject: SML-NJ for CygWin32 Bugs/Problems
From: [email-masked] (Gary Fuehrer)

16 Jun 1997 19:41:38 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <6CC63E2E4FC1D011A2A700609716117A0E6DA2.cygnus.gnu-win32@seawolf>
Original-To: [email-masked]
X-Priority: 3
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1457.3)
Content-Type: text/plain;
	charset="iso-8859-1"
Original-Sender: [email-masked]

I am attempting to get Standard ML of New Jersey (version 109.29) built
and working under CygWin32 (version b18).  CygWin32 is excellent, and
I'm having only minor difficulties getting this to happen.  Would
someone consider the following problems I'm having and give me some
feedback as to how resolvable/impossible they might be?

1.  SML-NJ builds an assembler source file by passing a bunch of macro
definitions and statements through gcc's preprocessor.  For x86, certain
assembly statements need to have a dollar sign before a numeric constant
(e.g. movl	$3, %eax).  Combined with C language macros, the
following kind of statements get passed to gcc when building the SML-NJ
runtime executable:
	#define REQ_CALLC   3
	:
	movl	$REQ_CALLC, %eax

The expected output of the preprocessor is:
	movl	$3, %eax

With the CygWin32 version of gcc, I get the following:
	movl	$REQ_CALLC, %eax

It looks as if the dollar sign is being interpreted as part of the name
of a symbol, which is then not defined as a macro and hence remains
un-expanded.  In demonstration of this, I can add a space separator
between the dollar sign and the macro and things work:
	movl $ REQ_CALLC, %eax  ==> preprocessor ==>  movl $ 3, %eax

This is clearly incorrect behavior on the part of CygWin's gcc.  Dollar
signs are not valid leading characters of C (or C++) identifiers.  I
might add that the gcc form Linux doesn't behave this way.

2.	The signal handling in CygWin32 doesn't let me do the following:
a.	Get and Set the "eip" register (or any register) of the
excepting thread.
b.	Ascertain the kind of floating point exception that occurred.
The need is for "siginfo_t" and "sigcontext" parameters that can be
optionally received and modified by signal handlers.  I noticed that
Sergey Okhapkin seems to have made it possible for a signal handler to
change the return address (equivalent to setting eip).  This may work
for me, but I also need to get other registers like "edi" and the state
of the floating point processor.  It seems like the extra optional
arguments technique is more traditional and more capable.

3.	There is no SIGVTALRM signal.  Is there an equivalent?

4.	"L_ctermid" is not defined (but "L_cuserid" is).

5.	The following definitions are not in the Posix sockets include
files (only the Windows socket stuff)
	#    define SO_SNDBUF       0x1001          /* send buffer size
*/
	#    define SO_RCVBUF       0x1002          /* receive buffer
size */
	#    define SO_SNDLOWAT     0x1003          /* send low-water
mark */
	#    define SO_RCVLOWAT     0x1004          /* receive low-water
mark */
	#    define SO_SNDTIMEO     0x1005          /* send timeout */
	#    define SO_RCVTIMEO     0x1006          /* receive timeout
*/
	#    define SO_ERROR        0x1007          /* get error status
and clear */
	#    define SO_TYPE         0x1008          /* get socket type
*/

6.	This header file doesn't exist:
			#include <netinet/tcp.h>

7.	The following functions, declared in CygWin's header files, fail
to link:
	getnetbyname
	getnetbyaddr
	fpgetround
	fpsetround
	pause
	getgroups
	ctermid
	mkfifo
	fchown
	fpathconf

8.  "setitimer" is not available, although there seems to be some
mention of it in /winsup/cygwin.din.

I would appreciate any information or ideas anyone might have.

Thanks,
Gary

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".