Bug 000006

When Created: 06/30/1995 05:11:42
Against DJGPP version: 2.00.beta1
By whom:
Abstract: Can't run DJGPP V2 binaries on PC with no co-processor
Can't do anything useful with the V2 binaries on my 386SX with
 no maths coprocessor.  Everything fails with SIGNOFP.  It's 
not just the compiler -  make and info fail in the same way.
Strangely, the first program run in a DOS window is OK, but
everything after that fails with SIGNOFP.  E.g. make starts OK
and invokes gcc, which then fails; info will run once OK, but 
if called again in the same DOS window it crashes.

Difficult to provide any diagnostics under the circumstances.
I removed emu387.dxe from /bin to check what would happen: now
the programs failed on the first call rather than the second.

Workaround added: 07/01/1995 17:35:55
By whom:
A simple workaround is to use the set 387=n command. This will turn
off the coprocessor detection that causes the exception. The exception
appears only if you spawn another program (eg make spawns gcc, gcc
spawns cpp). I think that the reason for the exception is the call to
_detect_80387 in the file npxsetup.c. The first time you start a
program, the coprocessor exception is turned off, and the
_detect_80387 function return 0 if you don't have a 387. In that case
the file emu387.dxe is loaded and the coprocessor excexption is
enabled (through __dpmi_set_coprocessor_emulation(3)). If you spawn
another program, the coprocessor reports still exceptions, but the
signal handler is not yet installed (-> exception). A workaround could
be to place a __dpmi_set_coprocessor(1) just before the call to
_detect_80387() in the function _npxsetup() in npx_setup.c. (i have
not yet tried that)

Note added: 07/03/1995 08:41:27
By whom:
Run-time environment on system experiencing this problem:  MS-DOS 5.0, EMM386
(extended memory only), Windows 3.1.  No other memory management.

Workaround added: 07/04/1995 04:56:15
By whom:
As already reported, setting environment variable 387=n (can be done inside
DJGPP.ENV) solves the problem.  However programs still crash with SIGNOFP
if a floating point operation (e.g. sqrt() ) is attempted.

Workaround added: 07/06/1995 04:50:32
By whom:
To use floating-point operations, you must also do
	set EMU387=c:/<djgpp V2 directory>/bin/emu387.dxe.  
This can be done in the DJGPP.ENV file.
(Thanks to Christian Domp for this explanation.)

Fixed in version 2.00.beta2 on 07/08/1995 23:20:34
By whom:

  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010