Update to firebird 3.0 - install build

Lionel Elie Mamane lionel at mamane.lu
Sat Jun 18 13:37:41 UTC 2016


(2nd sending with correct address for mailing list. Please CC the
 mailing list so that the community at large can be updated of your
 progress, and other developers can give their advice and help, too.)

 Also please send a weekly status update the mailing list.)

On Sat, Jun 18, 2016 at 01:06:20PM +0200, Bunth Tamás wrote:

> You wrote on gerrit for the line:

> --with-fbplugins=$(INSTDIR)/$(LIBO_LIB_FOLDER) \

> "this will work only with a "dev install" in the build directory. It
> will not work for packaged / normal install builds."

> I have no idea how to solve this. Is there no variables, which points
> to the right folder, depending on which build has been made?

I was imprecise with my vocabulary. There are not two different
builds; all builds build into $(INSTDIR), and we developers use the
built LibreOffice directly from there for testing. But to make a
package, or a local installation, the final product is then copied
from $(INSTDIR) into $(INSTALLDIR), which is chosen by LibreOffice's
autogen.sh's --prefix argument.

So, in my opinion, a solution based on passing a full absolute path to
--with-fb-plugins will not work in both situations. The effect of that
is that the dlopen() call is to
dlopen("/the/full/path/passed/to/with-fplugins/libEngine12.so", ...)

No choice of full path will work in both situations.

My best hunch, whose beginning was in the first part of my email of 2
June with Message-Id <20160602191615.GA32068 at capsaicin.mamane.lu>, but
was not completely developed there, is to arrange for the dlopen()
call to be just:

dlopen("libEngine12.so", ...)

Then dlopen() will do a search in various directories as documented in
the manpage dlopen in section 3, and ld.so in section 8: rpath,
LD_LIBRARY_PATH, runpath, /etc/ld.so.cache, the directories configured
in /etc/ld.so.conf, ...

Since we want to control the first directory searched, we will use the
rpath, which is set at runtime. See e.g.

$ objdump -p instdir/program/libfirebird_sdbclo.so|grep RPATH
  RPATH                $ORIGIN

"$ORIGIN" is a special value that is replaced at *runtime* by (dixit
"man 8 ld.so") the directory containing the application executable.

AFAIK, that's how LibreOffice itself finds its various subpieces, such
as e.g. libfirebird_sdbclo.so, at least on Unix-like systems like
e.g. GNU/Linux. Anybody on the mailing list can teach us what happens
on Microsoft Windows and MacOS X?

But currently:

$ objdump -p instdir/program/libfbclient.so.2|grep RPATH
  RPATH                /usr/local/firebird/lib

So we need to patch the firebird build system (or configure it through
some argument to its ./configure) to put an rpath of "$ORIGIN" (this
exact string, not the contents of the ORIGIN environment variable)
instead of some absolute path.

See also my email of 2 June. I hope the additional information and
development in this email makes my idea clear.

-- 
Lionel


More information about the LibreOffice mailing list