Problem
The UNIX kernel fails to relink after installing a new driver. The error message refers to the symbol "_phystokv", as in:
# cd /etc/conf/cf.d
# ./link_unixThe UNIX Operating System will now be rebuilt.
This will take a few minutes. Please wait. Root for this system build is /
undefined first referenced
symbol in file
_phystokv /etc/conf/pack.d/kernel/space.o
i386ld fatal: Symbol referencing errors. No output written to unix
ERROR: Can not link-edit unix Cause
The driver was compiled under SCO OpenServer Release 5.0.4. A
changed header file causes some drivers that are compiled under
Release 5.0.4 to have this problem on SCO OpenServer 5.0.0 and
5.0.2.NOTE: This document is not a generic solution for undefined symbols.
It is specific to the symbol "_phystokv". Solution
This document describes two different approaches to fixing the
problem. One is intended for end-users, the other for driver
developers.IF YOU ARE AN END-USER OF THE DRIVER:
First contact the driver vendor to see whether a newer version of
the driver has been released. Refer the vendor to this document.If you cannot obtain a corrected driver, you can apply the following workaround yourself.
Edit the file /etc/conf/pack.d/kernel/space.c. Add the following
lines at the end of the file (it is suggested that you download
this document from SCO's World Wide Web pages and cut the lines
directly out of an electronic copy, instead of typing them in.)/* workaround for 5.0.4 driver compatibility on 5.0.0/5.0.2 */
#ifdef PHYSTOKV
caddr_t _phystokv(_paddr)
paddr_t _paddr;
{
return (caddr_t)phystokv(_paddr);
}
#endif /* PHYSTOKV */NOTE: This change may allow the driver to link, but it cannot be
guaranteed that it will work correctly. The driver vendor cannot
have tested the driver on SCO OpenServer 5.0.0 and 5.0.2, since
they would also have encountered the kernel linking problem. It
would be better to contact the driver vendor and obtain a corrected
driver.IF YOU ARE THE DEVELOPER OF THE DRIVER:
Change your source code so that when compiled on SCO OpenServer 5.0.4, it uses the macro PHYSTOKV rather than the macro phystokv. One way to do this is to add these lines to the driver source:
#include <sys/immu.h>
#ifdef PHYSTOKV
# undef phystokv
# define phystokv PHYSTOKV
#endifThe driver will now compile on SCO OpenServer 5.0.4, producing an
object which should not have link errors on Releases 5.0.0 and
5.0.2. It should also still compile on Releases 5.0.0 and 5.0.2.NOTE: Although it may link, it does not mean that it works. It is
important that you test your driver on each release you intend
it to support.