Subject: Of COMPAT_ options and building working binaries
To: None <netbsd-help@netbsd.org>
From: Eric S. Hvozda <hvozda@ack.org>
List: netbsd-help
Date: 01/10/2002 13:08:03
Recently, through the experience of building pine from source (sorry
pkgsrc won't do, I need to depotize it), I have become aware of a
intersting impasse:

It is possible, to build binaries that require COMPAT_ options to
run that are not present in the kernel that they were built under.

After successfully building pine, I went to test it and it went
into a tight loop, ignored both SIGSTOP, SIGQUIT and SIGTERM.  I
need to use SIGKILL to stop it.

Upon looking at process trace with kdump(1), I noted that the binary
was calling __sigaction14() in a tight loop.

Previously, I had run into the interesting experience that to have
talk(1) function, the kernel requires COMPAT_43 (though I can find
this document in no man page, a google search enlightened me).

Since I didn't build that binary, I thought it was understandable
that it may need compatability options that were present at compile
time.

So the output from kdump lead me to believe that I just needed
"options COMPAT_14" in the kernel.  After a few interations, it
became apparent I needed much more than that.  In the end I ended
up putting all the BSD specific COMPAT_ options back into the kernel
(previously a stripped all COMPAT_ options foolishly believing
that I had no need for them since I was not running binaries built
requiring them).

However I was suprised to learn, after much debugging, that it
was possible to build binaries that required compatibility options
that were not present in the kernel at binary compilation time.

So while I have resolved apparently options COMPAT_43 is required
to make talk(1) work, I still do not understand how and/or why I
need the additional COMPAT_ options.

Further I begin to wonder if some of the COMPAT_ options are really
mandatory, and I don't know it (man page pointer please if it is
documented and I have managed to miss it).

Has anyone else run into this experience?