Error when linking libglxtest.a

Chris Sherlock chris.sherlock79 at
Sun Nov 23 04:01:32 PST 2014

I've commited a patch that fixes this (thanks to mjayfrancis).

I suspect that it was caused by a change to the defaults of ld introduced
in one of the Ubuntu releases (also Debian has done the same thing) where
it now uses --as-needed

"Ubuntu is changing the way it handles shared library linking for the Natty
release. (Similar changes are being discussed for Debian.) Previously, the
linker (ld) would allow indirect linking of shared library symbols. For
example, if you had a function spin in the librarylibwheel, and the library
libcar used libwheel, then a program that used libcar would have the
ability to call spin even though it never directly used libwheel. This kind
of indirect linking leads to fragile code--when the dependency chain of a
shared library changes, it can break the program that used it.
Also in Natty, ld runs with the --as-needed option enabled by default. This
means that, in the example above, if no symbols from libwheelwere needed by
racetrack, then libwheel would not be linked even if it was explicitly
included in the command-line compiler flags. NOTE: The ld --as-needed default
was reverted for the final natty release, and will be re-enabled in the


On Sun, Nov 23, 2014 at 7:40 PM, Chris Sherlock <chris.sherlock79 at>

> Hi all,
> I'm getting a linking error when compling the vcl module - the issue is
> around libglxtest.a
> chris at LibreOfficeDev:~/repos/LibreOffice/core$ make vcl
> cd /home/chris/repos/LibreOffice/core/vcl && /usr/bin/make  -j 2 -rs
> [ DEP ] LNK:Executable/icontest
> [ LNK ] Executable/icontest
> [ LOC ] top level modules: vcl
> [ LOC ] loaded modules: vcl
> [ CUT ] vcl_fontcharmap
> [ CUT ] vcl_complextext
> /usr/bin/ld:
> /home/chris/repos/LibreOffice/core/workdir/LinkTarget/StaticLibrary/libglxtest.a(glxtest.o):
> undefined reference to symbol 'dlopen@@GLIBC_2.1'
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/ error
> adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> make[1]: ***
> [/home/chris/repos/LibreOffice/core/workdir/LinkTarget/Executable/icontest]
> Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [vcl] Error 2
> ---
> Anyone have any ideas? -ldl is set correctly, so can't work out why it
> can't link to libdl!
> I've cc'ed in moggi...
> Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list