> So the Tru64 linker is using the shared library instead of the archive
> library. Quick look in the ld [1] man page reveals why:
>
> When linking a shared object, ld searches all library
> directories for the
> shared object library (libx.so). If it cannot find the shared object
> library, it again searches all library directories for the
> archive library
> (libx.a).
While the man page is really unclear about this, it seems that the linker
can be told to use the first library it comes across with:
-oldstyle_liblookup
Cause ld to search each library directory, first for the shared object
library (libx.so) and then for the archive library (libx.a).
You have to read that line very carefully to understand the difference!
Normally it searches ALL directories first for a shared library and THEN it
searches for an archive library. With this flag it searches PER directory,
first for a shared lib in the dir and then for an archived lib in the dir,
before going to the next directory.
Adding -Wl,-oldstyle_liblookup didn't work. It gave a compile error. So I
added the -oldstyle_liblookup to the GCC spec linker_command section:
*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) -oldstyle_liblookup
%l %{pie:} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*}
%{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*}
%(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}
%{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
And then the cfengine source compiled & linked as it should.
I don't know if there is a way to make GCC add that option automatically to
it's spec file?!
[1]
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN1/0241
____.HTM
______________________________________________________________________
The OpenPKG Project www.openpkg.org
Developer Communication List [EMAIL PROTECTED]