Linking to a custom heimdal version

Stefan (metze) Metzmacher metze at samba.org
Thu Jan 27 09:40:21 GMT 2005


>
> "Stefan (metze) Metzmacher" <metze at samba.org> writes:
>
>> | 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...
>
> Its not portable, first of all -Wl is gcc-ism.
>
> gnu ld accepts this:
> -Wl,-rpath,/path1 -Wl,-rpath,/path2
>
> with osf/1 (dux (tru64)) ld accepts this
> -Wl,-rpath,/path1:/path2
>
> Using the gnu invocation with a osf/1 results in the equivalent of
> -Wl,-rpath,/path2
>
> and that will make you unhappy.
>
>> But it should fix your current problem, and only add the path flags when
>> they are not the system default
>
> I guess krb5-config should tell you the runtime link-editor paths somehow,
> but using -Wl, syntax is probably wrong.
>
> Now, if you had used libfool, it would have picked up the .la files, saw
> the runtime path included in the file, and automagicly added them to the
> link command. But then, you all seem to hate libtool so, I wont propose
> that.

I don't understand, what you mean here!

why should we use .la files?
(make install (in heimdal) only installs .so and .a files!)

we just link to the installed .so files and krb5-config --libs gives the
-L /path/to/my_heimdal_install/lib -lkrb5 -lgssapi

so at link time we'll get the correct libs e.g.
/path/to/my_heimdal_install/lib/libkrb5.so

but then the loader will use /usr/lib/libkrb5.so

what we could do in samba is to parse the krb5-config --libs output and
manually at -Wl,-rpath ... or something the current compiler/linker
understands...




--
metze

Stefan Metzmacher <metze at samba dot org>


More information about the samba-technical mailing list