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

Richard Sharpe realrichardsharpe at
Wed Apr 15 13:03:29 MDT 2015

On Wed, Apr 15, 2015 at 11:46 AM, Thomas Schulz <schulz at> 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
           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.

Richard Sharpe

More information about the samba-technical mailing list