Re: [Libreoffice] rpath / ... for extensions (and the case of PostgreSQL-SDBC)

2012-01-22 Thread Stephan Bergmann

On 01/22/2012 05:55 PM, Lionel Elie Mamane wrote:

Hi,

With respect to fdo#45090, that is the GNU/Linux dlopen() does not
find libldap50.so when loading PostgreSQL-SDBC's
postgresql-sdbc-impl.uno.so.

"Naturally", libldap50.so is in $INSTALL_DIR/program/.

Have we already solved this problem, and if yes, how do I apply the
solution to PostgreSQL-SDBC?


The "solution" is that extensions must only link against the handful of 
libraries in the URE interface (basically cppu, cppuhelper, sal, 
salhelper) and not against any others provided by LO.  Everything else 
is not supported and is an error.


The best fix would probably be to change postgresql-sdbc.oxt from a 
bundled extension into an -- optionally installable, but "proper" -- 
part of the installation.


A workaround hack for Linux would indeed be to modify RPATH, see 
 
(RUNPATH is link-time only, btw.).


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] rpath / ... for extensions (and the case of PostgreSQL-SDBC)

2012-01-22 Thread Lionel Elie Mamane
Hi,

With respect to fdo#45090, that is the GNU/Linux dlopen() does not
find libldap50.so when loading PostgreSQL-SDBC's
postgresql-sdbc-impl.uno.so.

"Naturally", libldap50.so is in $INSTALL_DIR/program/.

Have we already solved this problem, and if yes, how do I apply the
solution to PostgreSQL-SDBC?


If not:

As I understand the problem, in DT_R(UN)PATH, when loading
postgresql-sdbc-impl.uno.so, $ORIGIN is the directory contained that
.so file, not the directory containing soffice.bin. So in some sense,
postgresql-sdbc-impl.uno.so has the "wrong' DT_RUNPATH:

(RPATH)  Library rpath: [$ORIGIN:$ORIGIN/../ure-link/lib]
(RUNPATH)Library runpath: [$ORIGIN:$ORIGIN/../ure-link/lib]

Thinking of PostgreSQL-SDBC as a bundled extension, it should be:
 $ORIGIN/../../../program:$ORIGIN/../../../ure-link/lib
because it sits in $INSTALL_DIR/share/extensions/postgresql-sdbc

But if it is installed as a shared extension, then it needs to be:
 
$ORIGIN/../../../../../../../../program:$ORIGIN/../../../../../../../../ure-link/lib
because it is in 
$INSTALL_DIR/share/uno_packages/cache/uno_packages/FOO.tmp_/postgresql-sdbc-0.8.2.oxt/postgresql-sdbc-0.8.2/linux_x64.plt

So far, so good, we could just merge these four entries. But if it is
installed as a user extension? Then no amount of fiddling with $ORIGIN
will help, since it is in the user's home directory (and where depends
on the LibreOffice version... could be .config/libreoffice/3/... or in
.libreoffice/3/...), and there is no relationship between the
$INSTALL_DIR and that.


So, what can we do?

Either we change the soffice script to set LD_LIBRARY_PATH also on
GNU/Linux, or PostgreSQL-SDBC ships a second copy of libldap50.so.

Now that I think of it, only the copy solution will make it work with
a LibreOffice compiled with --with-openldap, since that LibreOffice
won't ship libldap50.so. But distros will hate that, so they need a
way to disable that... I'd say do it only if LibreOffice is not
configured to use its internal mozldap.

Any opinions, vetos, agreements?

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice