Subject: Re: lsof and _SUN3X_ define...
To: None <jeremy@baymoo.org>
From: Brad Spencer <brad@anduin.eldar.org>
List: port-sun3
Date: 09/15/2000 22:38:30
   On Fri, 15 Sep 2000, Mark Abene wrote:

   > [...] I'm noticing from "cpp -dM" that _SUN3X_ isn't
   > defined by the preprocessor.  Shouldn't it be???

   This is a good question, and I'm sorry I didn't answer it in the last
   message.  The answer is "no."  Userland applications should not be able to
   discern that they are either running on the SUN3 or SUN3X platforms in any
   way unless they explicitly ask the kernel.  If a userland program is
   failing to compile because a preprocessor symbol like this is missing then
   it is a sign that some unecessary kernel details are being divulged.

   In short, the bug is very likely an oversight in one of the header files.

   -J





I think that the base system has some trouble in this area.  If I recall
correctly, some of the LKMs that are created from /sys/lkm won't work
properly on the Sun 3/3x port because in some cases neither the define
SUN3 nor SUN3X is defined, and some of them include
/usr/include/machine/param.h.  Without either of those two defines set,
you will not get the proper /usr/include/machine/param3.h or
/usr/include/machine/param3x.h include.

Basically, in the current design, as far as I can tell, you can't always
mix LKMs that were compiled on a Sun 3 v.s. a Sun 3x.  LKMs are a little
bit of an odd case, but I suspect that any userland program that wants
access to those same defines will also have trouble.



[An example from a running 1.4Y Sun 3/80 system:

pippin# modload /usr/lkm/procfs.o
/usr/lkm/procfs.o: Undefined symbol `_KERNBASE' referenced from text segment
modload: can't prelink `/usr/lkm/procfs.o' creating `/usr/lkm/procfs'

KERNBASE is defined in /usr/include/machine/param3.h and
/usr/include/machine/param3x.h.  Other systems just have one of these, so
this all works for them

]



Brad Spencer - brad@anduin.eldar.org
http://anduin.eldar.org  - & -  http://mellon.ipv6.eldar.org [IPv6 only]
[finger brad@anduin.eldar.org for PGP public key]