On Thu, Jan 26, 2012 at 04:20:41PM +0400, Ilya Matveychikov wrote:
On 25.01.2012 21:19, Dmitry V. Levin wrote:
[...]
>While the patch is certainly correct, --enable-static-modules still fails
>to build even with this change applied.
>
>The straightforward command
>$ ./autogen.sh&& ./configure --enable-static-modules --disable-pie&&
make
>fails with the following complaint:
>make[3]: *** No rule to make target `../../libpam/libpam.la', needed by
>`pam_access.la'. Stop.
>
>In the usual way to build pam, i.e. not in --enable-static-modules mode,
>libpam is actually required to link pam modules, so "libpam" is placed
>before "modules" in the SUBDIRS list.
>When STATIC_MODULES is enabled, however, "modules" target goes first,
>due to that notorious static_modules structure.
>
>While pam_access.la (and other pam modules) doesn't actually need
>libpam.la in STATIC_MODULES mode, several modules (e.g. pam_mkhomedir,
>pam_selinux, pam_tally2, pam_timestamp) also build executables which link
>with libpam.la.
>
>I wonder how do you deal with this dependency loop.
Yes, there was a problem, but I can't reproduce it now. IIRC changing
SUBDIRS to 'libpam modules libpam...' helps.
When you build "libpam" before "modules" in STATIC_MODULES mode, you
get
libpam.la without all these modules/pam_*/*.a linked in.
The result libpam.a in this case is full of undefined references to
_pam_*_modstruct, and therefore is quite unusable, isn't it?
>BTW, --enable-static-modules mode seems to be broken for a long
time
>already. For example, pam_rhosts_auth was removed in 0.99.10.0 (which
>was released about four years ago) thus leaving static_modules with
>the undefined reference to _pam_rhosts_auth_modstruct. Since that time,
>some other changes broke STATIC_MODULES even more. There are quite a few
>pam modules maintained as separate projects nowadays, and this
>static_modules concept does not provide a convenient method to use them.
>That is, I'm not quite sure --enable-static-modules worths fixing at all.
Nevertheless, I've succeeded with static build and it seems that it works.
I suppose you had to disable some modules (including pam_selinux) and
build the tree several times with manual intervention to get it built
properly.
--
ldv