trouble compiling pam_ldap under solaris 2.9

View: New views
3 Messages — Rating Filter:   Alert me  

trouble compiling pam_ldap under solaris 2.9

by Mark.Merchant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

any ideas? thx.

bash-2.05# make
make  all-am
make[1]: Entering directory `/export/home/software/pam_ldap-184'
gcc  -g -O2 -Wall -fPIC -B dynamic -M ./exports.solaris -G -B group -lc -L/opt/ldap/lib -R/opt/ldap/lib -mcpu=v7 -m32 -L/opt/ldap/lib -R/opt/ldap/lib -o pam_nldap.so pam_nldap.o md5.o  -lldap -llber -lnsl -lcrypt -lresolv -lpam -ldl
gcc: ./exports.solaris: linker input file unused because linking not done
gcc: -lc: linker input file unused because linking not done
gcc: pam_nldap.o: linker input file unused because linking not done
gcc: md5.o: linker input file unused because linking not done
gcc: -lldap: linker input file unused because linking not done
gcc: -llber: linker input file unused because linking not done
gcc: -lnsl: linker input file unused because linking not done
gcc: -lcrypt: linker input file unused because linking not done
gcc: -lresolv: linker input file unused because linking not done
gcc: -lpam: linker input file unused because linking not done
gcc: -ldl: linker input file unused because linking not done
make[1]: Leaving directory `/export/home/software/pam_ldap-184'


Mark Merchant
Unix Systems Admin, Huntington Banks
7 Easton Oval, Cols, Oh 43219
tel:614-331-9806 cel:614-917-8218 pag:614-917-8218


640K ought to be enough for anybody.
Bill Gates

Re: trouble compiling pam_ldap under solaris 2.9

by Thomas Glanzmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mark,

* Mark.Merchant@... <Mark.Merchant@...> [090825 21:00]:
> any ideas? thx.

the following works and give you a nss_ldap with as much statically linked
stuff as possible but you need to download the dependencies. In addition to
that I insalled a recent version of forte 12 for compiling and gmake from
blastwave.

export CC=cc
export CXX=CC
export PATH="/local/forte12/SUNWspro/bin:/usr/ccs/bin:/usr/bin:/opt/csw/bin"

(
        cd Libnet-1.0.2a
        ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

export LDFLAGS='-L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib'
export CPPFLAGS='-I/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/include'

(
        cd openssl-0.9.8c
        ./Configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies shared solaris-x86-cc
        gmake
        gmake install
)

(
        cd krb5-1.4.4/src
        ./configure --enable-static --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --exec-prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

(
        cd cyrus-sasl-2.1.22
        ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --with-staticsasl
        gmake
        gmake install
)

(
        cd db-4.5.20/build_unix
        ../dist/configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --disable-shared
        gmake
        gmake install
)

(
        cd openldap-2.3.39
        LIBS="-lrt" ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

(
        cd nss_ldap-260
        ./configure --exec-prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-schema-mapping --enable-rfc2307bis --enable-configurable-krb5-ccname-gssapi
        gmake
        cc  -g  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib -o nss_ldap.so -Bdirect -z nodelete -Bdynamic -M ./exports.solaris -G ldap-nss.o ldap-pwd.o ldap-grp.o ldap-netgrp.o ldap-rpc.o ldap-hosts.o ldap-network.o ldap-proto.o ldap-spwd.o ldap-alias.o ldap-service.o ldap-schema.o ldap-ethers.o ldap-bp.o ldap-automount.o util.o ltf.o snprintf.o resolve.o dnsconfig.o irs-nss.o pagectrl.o ldap-sldap.o ldap-init-krb5-cache.o  -Bstatic -lldap -llber -lsasl2 -Bstatic -lssl -lcrypto -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -ldl -lsocket -lnsl -lresolv
)

        # cc -o pam_krb5.so -G -xldscope=symbolic  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib api-account.o api-auth.o api-password.o api-session.o  auth.o compat.o context.o logging.o options.o prompting.o  support.o -L/usr/lib -R/usr/lib -Bstatic -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -lpam -lresolv  -lsocket   -lnsl

        Thomas

# vim: ft=perl

$progname = 'nss_ldap';
$version = '260';

my $libnet_version = '1.0.2a';
my $openssl_version = '0.9.8c';
my $krb5_version = '1.4.4';
my $sasl_version = '2.1.22';
my $openldap_version = '2.3.39';
my $berkeley_version = '4.5.20';

# TODO: Search for krb5.conf in /etc/krb5/krb5.conf
# At the moment it tries the following two paths:
# /etc/krb5.conf
# /var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/krb5.conf

# ldap.conf wird auch an einer komischen Stelle gesucht, ist aber wahrscheinlich egal:
# open("/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/openldap/ldap.conf", O_RDONLY) Err#2 ENOENT
# stat("/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/krb5.conf", 0xFFBFE798) Err#2 ENOENT

$buildroot = "${builddir}/${progname}-${version}-buildroot";

$category  = 'application';
$vendor    = 'http://www.padl.com/ packaged by Thomas Glanzmann';

@sources   = ("${progname}.tgz",
               "libnet-${libnet_version}.tar.gz",
               "openssl-${openssl_version}.tar.gz",
               "krb5-${krb5_version}.tar.gz",
               "cyrus-sasl-${sasl_version}.tar.gz",
               "openldap-${openldap_version}.tar.gz",
               "db-${berkeley_version}.tar.gz",
);

@patches   = (['nss_ldap.patch', "${progname}-${version}", '-p1']);
             
@packages  = ({
                pkgname      => 'nssldap',
                filename     => 'nss_ldap',
                name         => "nssldap - retrieve system databases from LDAP directories",
                dependencies => [],
                filelist     => [qw(usr)]
                });

$copyright = "${progname}-${version}/COPYING";

$build     = <<"EOF";
export CC=cc
export CXX=CC
export PATH="${sunwspropath}:/usr/ccs/bin:/usr/bin:/opt/csw/bin"

(
        cd Libnet-${libnet_version}
        ./configure --prefix=${buildroot}/dependencies
        gmake
        gmake install
)

export LDFLAGS='-L${buildroot}/dependencies/lib'
export CPPFLAGS='-I${buildroot}/dependencies/include'

(
        cd openssl-${openssl_version}
        ./Configure --prefix=${buildroot}/dependencies shared solaris-x86-cc
        gmake
        gmake install
)

(
        cd krb5-${krb5_version}/src
        ./configure --enable-static --prefix=${buildroot}/dependencies --exec-prefix=${buildroot}/dependencies
        gmake
        gmake install
)

(
        cd cyrus-sasl-${sasl_version}
        ./configure --prefix=${buildroot}/dependencies --with-staticsasl
        gmake
        gmake install
)

(
        cd db-${berkeley_version}/build_unix
        ../dist/configure --prefix=${buildroot}/dependencies --disable-shared
        gmake
        gmake install
)

(
        cd openldap-${openldap_version}
        LIBS="-lrt" ./configure --prefix=${buildroot}/dependencies
        gmake
        gmake install
)

(
        cd ${progname}-${version}
        ./configure --exec-prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-schema-mapping --enable-rfc2307bis --enable-configurable-krb5-ccname-gssapi
        gmake
        cc  -g  -L${buildroot}/dependencies/lib -o nss_ldap.so -Bdirect -z nodelete -Bdynamic -M ./exports.solaris -G ldap-nss.o ldap-pwd.o ldap-grp.o ldap-netgrp.o ldap-rpc.o ldap-hosts.o ldap-network.o ldap-proto.o ldap-spwd.o ldap-alias.o ldap-service.o ldap-schema.o ldap-ethers.o ldap-bp.o ldap-automount.o util.o ltf.o snprintf.o resolve.o dnsconfig.o irs-nss.o pagectrl.o ldap-sldap.o ldap-init-krb5-cache.o  -Bstatic -lldap -llber -lsasl2 -Bstatic -lssl -lcrypto -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -ldl -lsocket -lnsl -lresolv
)

        # cc -o pam_krb5.so -G -xldscope=symbolic  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib api-account.o api-auth.o api-password.o api-session.o  auth.o compat.o context.o logging.o options.o prompting.o  support.o -L/usr/lib -R/usr/lib -Bstatic -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -lpam -lresolv  -lsocket   -lnsl
EOF

Re: trouble compiling pam_ldap under solaris 2.9

by Thomas Glanzmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mark,

[RESEND: I forgot to attach a patch, without this patch it was
compiling, but failed to run because it couldn't determine the symbold
on runtime very nasty to track down because everything appears to be
fine, but it doesn't work at all.]

* Mark.Merchant@... <Mark.Merchant@...> [090825 21:00]:
> any ideas? thx.

the following works and give you a nss_ldap with as much statically linked
stuff as possible but you need to download the dependencies. In addition to
that I insalled a recent version of forte 12 for compiling and gmake from
blastwave.

export CC=cc
export CXX=CC
export PATH="/local/forte12/SUNWspro/bin:/usr/ccs/bin:/usr/bin:/opt/csw/bin"

(
        cd Libnet-1.0.2a
        ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

export LDFLAGS='-L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib'
export CPPFLAGS='-I/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/include'

(
        cd openssl-0.9.8c
        ./Configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies shared solaris-x86-cc
        gmake
        gmake install
)

(
        cd krb5-1.4.4/src
        ./configure --enable-static --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --exec-prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

(
        cd cyrus-sasl-2.1.22
        ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --with-staticsasl
        gmake
        gmake install
)

(
        cd db-4.5.20/build_unix
        ../dist/configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies --disable-shared
        gmake
        gmake install
)

(
        cd openldap-2.3.39
        LIBS="-lrt" ./configure --prefix=/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies
        gmake
        gmake install
)

(
        cd nss_ldap-260
        ./configure --exec-prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-schema-mapping --enable-rfc2307bis --enable-configurable-krb5-ccname-gssapi
        gmake
        cc  -g  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib -o nss_ldap.so -Bdirect -z nodelete -Bdynamic -M ./exports.solaris -G ldap-nss.o ldap-pwd.o ldap-grp.o ldap-netgrp.o ldap-rpc.o ldap-hosts.o ldap-network.o ldap-proto.o ldap-spwd.o ldap-alias.o ldap-service.o ldap-schema.o ldap-ethers.o ldap-bp.o ldap-automount.o util.o ltf.o snprintf.o resolve.o dnsconfig.o irs-nss.o pagectrl.o ldap-sldap.o ldap-init-krb5-cache.o  -Bstatic -lldap -llber -lsasl2 -Bstatic -lssl -lcrypto -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -ldl -lsocket -lnsl -lresolv
)

        # cc -o pam_krb5.so -G -xldscope=symbolic  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib api-account.o api-auth.o api-password.o api-session.o  auth.o compat.o context.o logging.o options.o prompting.o  support.o -L/usr/lib -R/usr/lib -Bstatic -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -lpam -lresolv  -lsocket   -lnsl

        Thomas

# vim: ft=perl

$progname = 'nss_ldap';
$version = '260';

my $libnet_version = '1.0.2a';
my $openssl_version = '0.9.8c';
my $krb5_version = '1.4.4';
my $sasl_version = '2.1.22';
my $openldap_version = '2.3.39';
my $berkeley_version = '4.5.20';

# TODO: Search for krb5.conf in /etc/krb5/krb5.conf
# At the moment it tries the following two paths:
# /etc/krb5.conf
# /var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/krb5.conf

# ldap.conf wird auch an einer komischen Stelle gesucht, ist aber wahrscheinlich egal:
# open("/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/openldap/ldap.conf", O_RDONLY) Err#2 ENOENT
# stat("/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/etc/krb5.conf", 0xFFBFE798) Err#2 ENOENT

$buildroot = "${builddir}/${progname}-${version}-buildroot";

$category  = 'application';
$vendor    = 'http://www.padl.com/ packaged by Thomas Glanzmann';

@sources   = ("${progname}.tgz",
               "libnet-${libnet_version}.tar.gz",
               "openssl-${openssl_version}.tar.gz",
               "krb5-${krb5_version}.tar.gz",
               "cyrus-sasl-${sasl_version}.tar.gz",
               "openldap-${openldap_version}.tar.gz",
               "db-${berkeley_version}.tar.gz",
);

@patches   = (['nss_ldap.patch', "${progname}-${version}", '-p1']);
             
@packages  = ({
                pkgname      => 'nssldap',
                filename     => 'nss_ldap',
                name         => "nssldap - retrieve system databases from LDAP directories",
                dependencies => [],
                filelist     => [qw(usr)]
                });

$copyright = "${progname}-${version}/COPYING";

$build     = <<"EOF";
export CC=cc
export CXX=CC
export PATH="${sunwspropath}:/usr/ccs/bin:/usr/bin:/opt/csw/bin"

(
        cd Libnet-${libnet_version}
        ./configure --prefix=${buildroot}/dependencies
        gmake
        gmake install
)

export LDFLAGS='-L${buildroot}/dependencies/lib'
export CPPFLAGS='-I${buildroot}/dependencies/include'

(
        cd openssl-${openssl_version}
        ./Configure --prefix=${buildroot}/dependencies shared solaris-x86-cc
        gmake
        gmake install
)

(
        cd krb5-${krb5_version}/src
        ./configure --enable-static --prefix=${buildroot}/dependencies --exec-prefix=${buildroot}/dependencies
        gmake
        gmake install
)

(
        cd cyrus-sasl-${sasl_version}
        ./configure --prefix=${buildroot}/dependencies --with-staticsasl
        gmake
        gmake install
)

(
        cd db-${berkeley_version}/build_unix
        ../dist/configure --prefix=${buildroot}/dependencies --disable-shared
        gmake
        gmake install
)

(
        cd openldap-${openldap_version}
        LIBS="-lrt" ./configure --prefix=${buildroot}/dependencies
        gmake
        gmake install
)

(
        cd ${progname}-${version}
        ./configure --exec-prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-schema-mapping --enable-rfc2307bis --enable-configurable-krb5-ccname-gssapi
        gmake
        cc  -g  -L${buildroot}/dependencies/lib -o nss_ldap.so -Bdirect -z nodelete -Bdynamic -M ./exports.solaris -G ldap-nss.o ldap-pwd.o ldap-grp.o ldap-netgrp.o ldap-rpc.o ldap-hosts.o ldap-network.o ldap-proto.o ldap-spwd.o ldap-alias.o ldap-service.o ldap-schema.o ldap-ethers.o ldap-bp.o ldap-automount.o util.o ltf.o snprintf.o resolve.o dnsconfig.o irs-nss.o pagectrl.o ldap-sldap.o ldap-init-krb5-cache.o  -Bstatic -lldap -llber -lsasl2 -Bstatic -lssl -lcrypto -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -ldl -lsocket -lnsl -lresolv
)

        # cc -o pam_krb5.so -G -xldscope=symbolic  -L/var/tmp/sithglan-pkg/nss_ldap-260-buildroot/dependencies/lib api-account.o api-auth.o api-password.o api-session.o  auth.o compat.o context.o logging.o options.o prompting.o  support.o -L/usr/lib -R/usr/lib -Bstatic -lgssapi_krb5 -lcom_err -lkrb5 -lk5crypto -lkrb5support -Bdynamic -lpam -lresolv  -lsocket   -lnsl
EOF

commit 13e89c8747ce5b71966cce2afa28b9f6212ff568
Author: Thomas Glanzmann <sithglan@...>
Date:   Fri May 9 07:50:16 2008 +0200

    make crap work

diff --git a/ldap-sldap.c b/ldap-sldap.c
index 5f8f85f..0af8b67 100644
--- a/ldap-sldap.c
+++ b/ldap-sldap.c
@@ -247,7 +247,9 @@ __ns_ldap_getParam (const ParamIndexType type, void ***data,
       break;
     }
 
+#if 0
   debug ("<== __ns_ldap_getParam (ret=%s)", NS_LDAP_ERR2STR (ret));
+#endif
 
   return ret;
 }
@@ -566,8 +568,10 @@ __ns_ldap_parseEntry (LDAPMessage * msg, ldap_state_t * state,
     {
       __ns_ldap_freeEntry (&entry);
       cookie->ret = ret;
+#if 0
       debug ("<== __ns_ldap_parseEntry (failed to init result: %s)",
      NS_LDAP_ERR2STR (ret));
+#endif
       return __ns_ldap_mapError (ret);
     }
   cookie->result->entry = entry;
@@ -597,7 +601,9 @@ __ns_ldap_parseEntry (LDAPMessage * msg, ldap_state_t * state,
 
   cookie->ret = ret;
 
+#if 0
   debug ("<== __ns_ldap_parseEntry (ret=%s)", NS_LDAP_ERR2STR (ret));
+#endif
 
   return __ns_ldap_mapError (ret);
 }
@@ -1150,8 +1156,10 @@ __ns_ldap_firstEntry (const char *service,
 
   *pCookie = cookie;
 
+#if 0
   debug ("<== __ns_ldap_firstEntry ret=%s cookie=%p", NS_LDAP_ERR2STR (ret),
  cookie);
+#endif
 
   return ret;
 }
@@ -1185,7 +1193,9 @@ __ns_ldap_nextEntry (void *_cookie,
 
   _nss_ldap_leave ();
 
+#if 0
   debug ("<== __ns_ldap_nextEntry ret=%s", NS_LDAP_ERR2STR (ret));
+#endif
 
   return ret;
 }
@@ -1273,7 +1283,9 @@ __ns_ldap_list (const char *map,
 
   _nss_ldap_leave ();
 
+#if 0
   debug ("<== __ns_ldap_list ret=%s", NS_LDAP_ERR2STR (ret));
+#endif
 
   return ret;
 }