Comment 7 for bug 1708048

Revision history for this message
Mike Rylander (mrylander) wrote :

More:

I can't yet figure out how to tell libtool to set RPATH instead of RUNPATH on Stretch.

The following patch:

diff --git a/src/libopensrf/Makefile.am b/src/libopensrf/Makefile.am
index fd3729b9..9bd043d1 100644
--- a/src/libopensrf/Makefile.am
+++ b/src/libopensrf/Makefile.am
@@ -98,6 +98,7 @@ noinst_PROGRAMS = osrf_json_test
 bin_PROGRAMS = opensrf-c
 opensrf_c_SOURCES = opensrf.c
 opensrf_c_DEPENDENCIES = libopensrf.la
+opensrf_c_LDFLAGS = -rpath $(libdir)

 osrf_json_test_SOURCES = osrf_json_test.c $(JSON_TARGS) $(JSON_DEP) $(JSON_TARGS_HEADS) $(JSON_DEP_HEADS)
 osrf_json_test_DEPENDENCIES = libopensrf.la

Seems to generate the right output during the build:

/bin/bash ../../libtool --tag=CC --mode=link gcc -D_LARGEFILE64_SOURCE -DNDEBUG -pipe -g -Wall -O2 -fPIC -I/home/opensrf/opensrf/include/ -I/usr/include/libxml2/ -I/usr/include/apache2 -I/usr/include/apr-1.0 -DASSUME_STATELESS -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -DOSRF_JSON_ENABLE_XML_UTILS -g -O2 -rpath /openils/lib -o opensrf-c opensrf.o -lopensrf -lxml2 -lreadline -lncurses -ldl
libtool: link: gcc -D_LARGEFILE64_SOURCE -DNDEBUG -pipe -g -Wall -O2 -fPIC -I/home/opensrf/opensrf/include/ -I/usr/include/libxml2/ -I/usr/include/apache2 -I/usr/include/apr-1.0 -DASSUME_STATELESS -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -DOSRF_JSON_ENABLE_XML_UTILS -g -O2 -o .libs/opensrf-c opensrf.o /home/opensrf/opensrf/src/libopensrf/.libs/libopensrf.so -lxml2 -lreadline -lncurses -ldl -Wl,-rpath -Wl,/openils/lib

But readelf still says:

 0x000000000000001d (RUNPATH) Library runpath: [/openils/lib]

Instead of what I want:

 0x000000000000000f (RPATH) Library rpath: [/openils/lib]

Thoughts appreciated...