Subject: Re: sigsetjmp, and siglongjmp where are they? (fwd)
To: None <amiga@NetBSD.ORG>
From: Arthur Hoffmann <hoffmann@it.ntu.edu.au>
List: amiga
Date: 05/11/1995 14:55:57
Forwarded message:
>From thieleke@icaen.uiowa.edu Thu May 11 07:38:00 1995
Organization: Iowa Computer Aided Engineering Network, University of Iowa
From: Jeffrey Ray Thieleke <thieleke@icaen.uiowa.edu>
Message-Id: <199505102159.QAA23296.482A2@icaen.uiowa.edu>
Subject: Re: sigsetjmp, and siglongjmp where are they?
To: hoffmann@it.ntu.edu.au (Arthur Hoffmann)
Date: Wed, 10 May 1995 16:59:19 -0500 (CDT)
In-Reply-To: <199505101321.WAA00653@morinda.cs.ntu.edu.au> from "Arthur Hoffmann" at May 10, 95 10:51:14 pm
Content-Type: text
Content-Length: 1819      

> I seem to have a bad day today.

You and me both.  I got about an 1:30 of sleep last night, because of a 
final at 7:30am!


> I wanted to compile elm, and everyting compiled fine, but it didn't
> link, the errors are as follows:
> 
> editmsg.o: Undefined symbol `_siglongjmp' referenced from text segment
> editmsg.o: Undefined symbol `_sigsetjmp' referenced from text segment
> in_utils.o: Undefined symbol `_sigsetjmp' referenced from text segment
> signals.o: Undefined symbol `_siglongjmp' referenced from text segment
> signals.o: Undefined symbol `_siglongjmp' referenced from text segment
> signals.o: Undefined symbol `_siglongjmp' referenced from text segment
> *** Error code 1
> 
> Stop.
> *** Error code 1


I sent this patch to the Elm people 2 days ago!

The problem is that gcc-m68k doesn't have sigsetjmp or siglongjmp, even 
though it is listed in the include header.

Easy solution-
replace all of the sigsetjmp() with setjmp(), and all of the siglongjmp() 
with longjmp().  There are many ways to do this...everything from 
actually editting the files to creating a macro in one of the program's 
include file.  Elm already does this...see hdrs/.  I don't remember which 
file it is, but a "grep -i siglongjmp *" will find it.  My patch was to 
include "|| !defined(__NetBSD__)" after "!defined(386BSD)".

If you want, cut Elm's siglongjmp/sigsetjmp -> longjmp/setjmp macro out, 
and paste it into any program that expects sigjmps.  Also read the 
siglongjmp man page, since while longjmp/setjmp will almost always work, 
there is one case where you would want to use _longjmp & _setjmp.



In general, this should fix any sigjmp problem:

#if defined(__NetBSD__) && defined(__mc68000__)
#define siglongjmp(env,val) longjmp(env,val)
#define sigsetjmp(env,val) setjmp(env)
#endif



Jeff Thieleke