# \-rpath linker option?

**URL:** <https://www.ruby-forum.com/t/rpath-linker-option/238316>\
**Category:** NGINX\
**Created:** [January 3, 2014, 6:19am UTC](https://www.ruby-forum.com/t/rpath-linker-option/238316 "2014-01-03T06:19:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 3, 2014, 6:19am UTC](https://www.ruby-forum.com/t/rpath-linker-option/238316/1 "2014-01-03T06:19:31Z")

</div>

I’m having trouble with dll hell on Debian and Ubuntu with OpenSSL.  
Debian and Ubuntu insist on runtime linking with the copy in /usr/lib.  
Fedora and Red Hat are OK because they don’t use OpenSSL by default,  
so they are not present in /usr/lib.

I’ve tried specifying a rpath in ld options:

–with-ld-opt="-rpath=$OPENSSL\_LIB\_DIR -ldl"

That results in:

checking for C compiler … found

- using GNU C compiler  
checking for --with-ld-opt="-rpath=/usr/local/ssl/lib -ldl" … not  
found  
./auto/configure: error: the invalid value in  
–with-ld-opt="-rpath=/usr/local/ssl/lib -ldl"

The path is valid:

$ ls /usr/local/ssl/lib  
engines libcrypto.so libssl.a libssl.so.1.0.0  
libcrypto.a libcrypto.so.1.0.0 libssl.so pkgconfig

LD\_LIBRARY\_PATH and LD\_PRELOAD tricks don’t work because they are  
dropped when running as root.

Any ideas how to proceed?

---

<div class="post-metadata">

**Author:** ![Jeffrey\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6f9a4e/32.png) [@Jeffrey\_W](https://www.ruby-forum.com/u/Jeffrey_W)\
**Post date:** [January 3, 2014, 2:38pm UTC](https://www.ruby-forum.com/t/rpath-linker-option/238316/2 "2014-01-03T14:38:24Z")

</div>

Hello!

On Fri, Jan 03, 2014 at 12:18:27AM -0500, Jeffrey W. wrote:

> checking for C compiler … found
> 
> - using GNU C compiler  
> checking for --with-ld-opt=“-rpath=/usr/local/ssl/lib -ldl” … not found  
> ./auto/configure: error: the invalid value in  
> –with-ld-opt=“-rpath=/usr/local/ssl/lib -ldl”

Try looking into objs/autoconf.err. Most likely, your cc want it  
to be spelled like “-Wl,-rpath=…”.

–  
Maxim D.  
[http://nginx.org/](http://nginx.org/)
