Linking to a custom heimdal version
Stefan (metze) Metzmacher
metze at samba.org
Wed Jan 26 14:27:16 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stefan (metze) Metzmacher schrieb:
| Stefan (metze) Metzmacher schrieb:
| | Hi Andrew,
| |
| | I think I have found what your problem is with linking to a custom
| heimdal
| |
| | heimdal's krb5-config returns this:
| |
| | metze at COMPILIX:~> krb5-config --libs
| | -L/usr/lib -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv
| |
| | or this for a custom version
| |
| | metze at COMPILIX:~/samba4/samba4-heimdal/bin> ./krb5-config --libs
| | -L/home/People/metze/samba4/samba4-heimdal/lib -lkrb5 -lasn1 -lcrypto
| | -lroken -lcrypt -lresolv
| |
| |
| | and MIT krb5-config returns this
| |
| | metze at routox:~> krb5-config --libs
| | -L/usr/lib -Wl,-rpath -Wl,/usr/lib -lkrb5 -lk5crypto -lcom_err
| |
| | so heimdal is missing the -Wl,-rpath -Wl,<LIBPATH>
| |
| | that means samba links fine to the custom libs (-L is for that) but at
| | runtime the loader uses the
| | system libs (-Wl,-rpath... is for this one)
|
| I have a patch for this, but I think -Wl,-rpath is maybe not portable to
| all linkers, we need to
| check that...
|
| But it should fix your current problem, and only add the path flags when
| they are not the system default
I have tested that on my SuSE 9.2 box and I finally got an output like this
with the patch applied
metze at COMPILIX:~/samba/4.0/samba4-work/source> ldd bin/smbd
~ linux-gate.so.1 => (0xffffe000)
~ libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40030000)
~ libreadline.so.5 => /lib/libreadline.so.5 (0x40043000)
~ libncurses.so.5 => /lib/libncurses.so.5 (0x40070000)
~ libpopt.so.0 => /usr/lib/libpopt.so.0 (0x400b5000)
~ libcrypt.so.1 => /lib/libcrypt.so.1 (0x400bd000)
~ libresolv.so.2 => /lib/libresolv.so.2 (0x400ef000)
~ libdl.so.2 => /lib/libdl.so.2 (0x40102000)
~ libcom_err.so.2 => /lib/libcom_err.so.2 (0x40107000)
~ libgssapi.so.1 => /home/People/metze/samba4/samba4-heimdal/lib/libgssapi.so.1 (0x4010a000)
~ libkrb5.so.17 => /home/People/metze/samba4/samba4-heimdal/lib/libkrb5.so.17 (0x40118000)
~ libasn1.so.6 => /home/People/metze/samba4/samba4-heimdal/lib/libasn1.so.6 (0x40150000)
~ libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0x40174000)
~ libroken.so.16 => /home/People/metze/samba4/samba4-heimdal/lib/libroken.so.16 (0x40266000)
~ libldap-2.2.so.7 => /usr/lib/libldap-2.2.so.7 (0x40276000)
~ liblber-2.2.so.7 => /usr/lib/liblber-2.2.so.7 (0x402a9000)
~ libc.so.6 => /lib/tls/libc.so.6 (0x402b6000)
~ /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
~ libdb-4.2.so => /usr/lib/tls/libdb-4.2.so (0x403cc000)
~ libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x404a2000)
~ libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0x404b7000)
| metze
|
| Stefan Metzmacher <metze at samba.org> www.samba.org
- ------------------------------------------------------------------------
Index: tools/krb5-config.in
===================================================================
- --- tools/krb5-config.in (revision 199)
+++ tools/krb5-config.in (working copy)
@@ -87,7 +87,10 @@
~ fi
~ if test "$do_libs" = "yes"; then
- - lib_flags="-L${libdir}"
+ lib_flags=""
+ if test x"/usr/lib" != x"${libdir}"; then
+ lib_flags="-L${libdir} -Wl,-rpath -Wl,${libdir}"
+ fi
~ case $library in
~ gssapi)
~ lib_flags="$lib_flags -lgssapi"
- --
metze
Stefan Metzmacher <metze at samba.org> www.samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB96jEm70gjA5TCD8RAosSAKDDQJPGXy0GGEE+Ld+VkjdOKepVUQCgkzvH
EXhtZSa1anShi72VBGVOXqE=
=nYHY
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list