Torrey McMahon wrote:
Rod Evans wrote:


I'd have thought things could be simpler by adding:

        -L usr/local/mysql/lib -L /usr/local/lib

to the link-edit command line (LDFLAGS?).

And don't forget, LD_LIBRARY_PATH is recognized by the runtime linker (ld.so.1) too. Thus you are forcing all commands executed within this environment to
search for their runtime dependencies in the LD_LIBRARY_PATH directories.

There again, perhaps you need the LD_LIBRARY_PATH to execute commands as
part of your build ... what do I know :-)


Isn't that why you also set the RPATH? In this example it would be ...

-L usr/local/mysql/lib -L /usr/local/lib -R /usr/local/mysql/lib -R /usr/local/lib

Yes.  A -L path tells ld(1) where to look for dependencies.
A -R path, records a path in the built object, telling ld.so.1(1)
where to look for the dependency at runtime.

Note: you should avoid telling ld(1) to look in directories it
doesn't need to, just as you should avoid recording runpaths
in objects that aren't needed.

Sometimes the -L and -R path are the same.

But, for build environments like OSNet, they can be different:

compilation environment:

        -L $(ROOTLIBDIR)/fm

runtime environment:

        % elfdump -d /usr/lib/fm/fmd/fmd | grep RPATH
              [14]  RPATH    0x30c3       /usr/lib/fm
        
which was created via -R /usr/lib/fm


--
Rod
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to