Passing -Wl, -rpath, /some/dir/where/shared/libs/hide to a module build

Thomas Schulz schulz at adi.com
Thu Apr 16 13:37:42 MDT 2015


> On Wed, Apr 15, 2015 at 11:46 AM, Thomas Schulz <schulz at adi.com> wrote:
> >> Hi folks,
> >>
> >> When building a Samba VFS module that needs to link against some
> >> shared-libs that hide in interesting places it looks like I would need
> >> to do something like:
> >>
> >>    bld.SAMBA3_MODULE('some-module', ..., cflags='-Wl,-rpath,/hiding/place', ...)
> >>
> >> Is that correct or is there a better way of doing it?
> >>
> >> --
> >> Regards,
> >> Richard Sharpe
> >
> > See the discussion and fix from Bug 10112.
> > The short answer is to use '-R' instead of '-rpath'.
> 
> Hmmm, that is strange because on our platform, CentOS 6.x, man ld says:
> 
>        -R filename
>        --just-symbols=filename
>            Read symbol names and their addresses from filename, but do not
>            relocate it or include it in the output.  This allows your output
>            file to refer symbolically to absolute locations of memory defined
>            in other programs.  You may use this option more than once.
> 
>            For compatibility with other ELF linkers, if the -R option is
>            followed by a directory name, rather than a file name, it is
>            treated as the -rpath option.
> 
> -- 
> Regards,
> Richard Sharpe

The deal is that linux linkers understand -R directroy but the Solaris linker
(at least) does not understand -rpath. It is possible that the fix for
Bug 10112 is doing some testing of linker abilities. I did not follow
all the details of what was done. 

Tom Schulz
Applied Dynamics Intl.
schulz at adi.com


More information about the samba-technical mailing list