Blame SOURCES/postgresql-libpqwalreceiver-rpath.patch

13fbc1
Even in SCL world we so far lived fine with --disable-rpath.  But in some
13fbc1
usecases, SCLized libpqwalreceiver.so needs to have RPATH set.
13fbc1
13fbc1
Resolves: rhbz#1550567
13fbc1
13fbc1
diff --git a/src/backend/replication/libpqwalreceiver/Makefile b/src/backend/replication/libpqwalreceiver/Makefile
13fbc1
index 75b0e2b..69b0de6 100644
13fbc1
--- a/src/backend/replication/libpqwalreceiver/Makefile
13fbc1
+++ b/src/backend/replication/libpqwalreceiver/Makefile
13fbc1
@@ -15,7 +15,11 @@ include $(top_builddir)/src/Makefile.global
13fbc1
 override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
13fbc1
 
13fbc1
 OBJS = libpqwalreceiver.o $(WIN32RES)
13fbc1
-SHLIB_LINK_INTERNAL = $(libpq)
13fbc1
+# Force rpath to be used even though we disable it everywhere else.  This is
13fbc1
+# needed because the 'libpqwalreceiver.so' is loaded into process (with
13fbc1
+# CREATE SUBSCRIPTION) which has dropped the $LD_LIBRARY_PATH variable from the
13fbc1
+# parent $bindir/postgress process.
13fbc1
+SHLIB_LINK_INTERNAL = $(libpq) $(rpath)
13fbc1
 SHLIB_LINK = $(filter -lintl, $(LIBS))
13fbc1
 SHLIB_PREREQS = submake-libpq
13fbc1
 PGFILEDESC = "libpqwalreceiver - receive WAL during streaming replication"