[Libreoffice] right way to control libs and flags on the link line
Caolán McNamara
caolanm at redhat.com
Thu Jul 7 08:33:10 PDT 2011
So, I want to be able to link vcl (libvcllo.so under Linux) against
internal cairo when ENABLE_LIBRSVG is enabled.
This works fine for me with my linker, but causes trouble on some other
setups (e.g. altlinux I think). Here's how the link line ends up, and
the first error.
R=/home/jd/lo/master && S=$R/bootstrap && O=$S/solver/350/unxlngx6.pro
&& W=$O/workdir && mkdir -p $W/LinkTarget/Library/ && g++ -shared
-Wl,-z,noexecstack '-Wl,-rpath,$ORIGIN:$ORIGIN/../ure-link/lib'
'-Wl,-rpath-link,$O/lib' -Wl,-z,defs -Wl,-rpath-link,/lib:/usr/lib
-Wl,-z,combreloc -L$S/solenv/unxlngx6/lib -L$O/lib -L
$S/solenv/unxlngx6/lib -Wl,--hash-style=gnu -Wl,--dynamic-list-cpp-new
-Wl,--dynamic-list-cpp-typeinfo -Wl,-Bsymbolic-functions
-Wl,--strip-all -Wl,-O1 -lfontconfig -lfreetype ...
$W/CxxObject/vcl/source/components/rasterizer_rsvg.o -Wl,--start-group
$O/lib/libgraphite2_off.a -Wl,--end-group -ltllo -lutllo -lsotlo
-lucbhelper4gcc3 -lbasegfxlo -lcomphelpgcc3 -luno_cppuhelpergcc3 -licuuc
-licule -licule -li18nisolang1gcc3 -li18npaperlo -li18nutilgcc3
-ljvmaccessgcc3 -luno_cppu -luno_sal -lcairo -ldl -lm -lpthread -o
$W/LinkTarget/Library/libvcllo.so
#
/home/jd/lo/master/bootstrap/solver/350/unxlngx6.pro/workdir/CxxObject/vcl/source/glyphs/gcach_ftyp.o: In function `FtFontInfo::GetFaceFT()':
#
gcach_ftyp.cxx:(.text+0x9e3): undefined reference to
`FT_New_Memory_Face'
You can see that we *do* have -lfontconfig -lfreetype at the start of
the linker line, and -lcairo at the end of it, but we get undefined
references to freetype functions.
Easiest fix would be to, for the internal cairo case, to have -lcairo
-lfreetype -lfontconfig there. So for a quick fix I added fontconfig to
the plain libs for unxgcc.mk and shoved in freetype + fontconfig into
Library_vcl.mk for Linux.
That's not really what I want to do, because that drops the exact linker
options for fontconfig and freetype that we have in FONTCONFIG_LIBS and
FREETYPE_LIBS.
So, I suppose the main question is: How should I get FONTCONFIG_LIBS and
FONTCONFIG_LIBS, currently placed into gb_Library_set_ldflags, to appear
after cairo in the link line.
The other question is, even outside of this specific issue, if the
current adding of FOO_LIBS into gb_Library_set_ldflags is the right way
to add those anyway ?
C.
More information about the LibreOffice
mailing list