Undefined PLT symbol "openpam ttyconv"

From Wikistix

After upgrading from NetBSD 2.0.2 to NetBSD 3.0, I found that many programs, including login and su would fail with the error:

Undefined PLT symbol "openpam_ttyconv" (symnum = 47)

A similar error in a chroot environment was:

Undefined symbol "_openpam_debug" referenced from COPY relocation in su

This turned out to be due to the fact that there was a libpam.so in /usr/pkg/lib, and I had placed that directory in /etc/ld.so.conf to work around other issues. My solution now has the following in /etc/ld.so.conf:

libm.so.0       machdep.fpu_present     1:libm387.so.0,libm.so.0
/lib
/usr/lib
/usr/X11R6/lib
/usr/pkg/lib