All,
Just added PostgreSQL plugin support to our Solaris 10 x64/GCC build,
and discovered that the resulting postgresql.so library doesn't have a
correctly configured runtime path.
# ldd postgresql.so
libpq.so.5 => (file not found)
libc.so.1 => /lib/64/libc.so.1
libgcc_s.so.1 => /usr/sfw/lib/64/libgcc_s.so.1
libm.so.2 => /lib/64/libm.so.2
I could just add an LDFLAGS environment variable including this path,
but this would be applied to all plugins/binaries.
It appears that the autoconf script is building libpq's LDFLAGS based on
the output of "pg_config --libs":
---
with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
...
for dir in $with_libpq_libdir; do
with_libpq_ldflags="$with_libpq_ldflags -L$dir"
done
---
Would it be harmful to other platforms to also add "-R$dir" to the
generated LDFLAGS for this plugin? I've attached a patch against 5.1.0
autoconf script which does so.
Thanks,
Scott Severtson
Chief Architect
Digital Measures
--- collectd-5.1.0.orig/configure.in 2012-05-30 10:07:47.548664625 -0400
+++ collectd-5.1.0.patch/configure.in 2012-05-30 10:08:07.098693292 -0400
@@ -3149,7 +3149,7 @@
then
if test -n "$with_libpq_libdir"; then
for dir in $with_libpq_libdir; do
- with_libpq_ldflags="$with_libpq_ldflags -L$dir"
+ with_libpq_ldflags="$with_libpq_ldflags -L$dir -R$dir"
done
fi
else
_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd