#556064 fontconfig incorrectly listed as a private library

Package:
libxft-dev
Source:
xft
Description:
FreeType-based font drawing library for X (development files)
Submitter:
Peter Fritzsche
Date:
2025-08-17 17:47:24 UTC
Severity:
normal
Tags:
#556064#5
Date:
2009-11-13 10:05:41 UTC
From:
To:
Tried to build your package and it fails to build with GNU binutils-gold. The
important difference is that --no-add-needed is the default behavior of of GNU
binutils-gold. Please provide all needed libraries to the linker when building
your executables.

Objects inside an .a archive aren't linked yet. This means that you must resolve
their symbols when linking to a program.

More informations can be found at
http://wiki.debian.org/qa.debian.org/FTBFS#A2009-11-02Packagesfailingbecausebinutils-gold.2BAC8-indirectlinking

g++ -L../../wxxt/utils/image/src -L../../wxxt/contrib/xpm/lib  -L../../mzscheme -L../wxs -L../../wxxt/src -o ../mred3m mrmain.o ../libmred3m.a ../../mzscheme/libmzscheme3m.a -lSM -lICE -lXaw -lXmu -lXt -lX11 -lXext  -lGL -lXrender -lXft   -lcairo   -lpng -lz -ljpeg -ldl -lm  -ldl -lm -rdynamic  ../../wxxt/contrib/xpm/lib/libXpm.a
/usr/bin/ld: ../libmred3m.a(Font.o): in function wxLoadQueryNearestAAFont(char const*, int, double, double, int, int, int, int, int, double):Font.cc(.text+0xf8d): error: undefined reference to 'FcMatrixRotate'
/usr/bin/ld: ../libmred3m.a(Font.o): in function wxLoadQueryNearestAAFont(char const*, int, double, double, int, int, int, int, int, double):Font.cc(.text+0xfb8): error: undefined reference to 'FcMatrixScale'
/usr/bin/ld: ../libmred3m.a(Font.o): in function wxLoadQueryNearestAAFont(char const*, int, double, double, int, int, int, int, int, double):Font.cc(.text+0x112e): error: undefined reference to 'FcPatternBuild'
/usr/bin/ld: ../libmred3m.a(Font.o): in function wxLoadQueryNearestAAFont(char const*, int, double, double, int, int, int, int, int, double):Font.cc(.text+0x11b9): error: undefined reference to 'FcPatternBuild'
/usr/bin/ld: ../libmred3m.a(Font.o): in function wxGetCompleteFaceList(int*, int):Font.cc(.text+0x31fe): error: undefined reference to 'FcFontSetDestroy'
/usr/bin/ld: ../libmred3m.a(Font.o): in function doFindAAFont(_XDisplay*, _XftFont*, int, int*):Font.cc(.text+0x345e): error: undefined reference to 'FcPatternGetInteger'
/usr/bin/ld: ../libmred3m.a(Font.o): in function doFindAAFont(_XDisplay*, _XftFont*, int, int*):Font.cc(.text+0x3496): error: undefined reference to 'FcPatternGetInteger'
/usr/bin/ld: ../libmred3m.a(Font.o): in function doFindAAFont(_XDisplay*, _XftFont*, int, int*):Font.cc(.text+0x34dc): error: undefined reference to 'FcPatternGetInteger'
/usr/bin/ld: ../libmred3m.a(Font.o): in function doFindAAFont(_XDisplay*, _XftFont*, int, int*):Font.cc(.text+0x3512): error: undefined reference to 'FcPatternGetInteger'
/usr/bin/ld: ../libmred3m.a(Font.o): in function doFindAAFont(_XDisplay*, _XftFont*, int, int*):Font.cc(.text+0x366d): error: undefined reference to 'FcPatternBuild'
collect2: ld returned 1 exit status
make[6]: *** [../mred3m] Error 1

#556064#10
Date:
2010-01-16 02:55:24 UTC
From:
To:
reassign 556064 libxft-dev 2.1.12-3
retitle 556064 fontconfig incorrectly listed as a private library
thanks

As shown below, the patch introduced in #389831 incorrectly moved
fontconfig to Requires.private.  Thus, packages linking against Xft with
--no-add-needed (or binutils-gold) FTBFS.  This can also be verified by
seeing that many of the symbols defined by Xft are simply a #define of
XftFoo to FcFoo.

$ grep -n XftPattern /usr/include/X11/Xft/XftCompat.h
101:typedef FcPattern   XftPattern;
122:#define XftPatternCreate    FcPatternCreate
123:#define XftPatternDuplicate FcPatternDuplicate
126:#define XftPatternDestroy   FcPatternDestroy
127:#define XftPatternFind              FcPatternFind
128:#define XftPatternAdd               FcPatternAdd
129:#define XftPatternGet               FcPatternGet
130:#define XftPatternDel               FcPatternDel
131:#define XftPatternAddInteger        FcPatternAddInteger
132:#define XftPatternAddDouble FcPatternAddDouble
133:#define XftPatternAddString(p,e,s)  FcPatternAddString(p,e,(FcChar8 *)(s))
134:#define XftPatternAddMatrix FcPatternAddMatrix
135:#define XftPatternAddBool   FcPatternAddBool
136:#define XftPatternGetInteger        FcPatternGetInteger
137:#define XftPatternGetDouble FcPatternGetDouble
138:#define XftPatternGetString(p,e,i,n)        FcPatternGetString(p,e,i,(FcChar8 **) (n))
139:#define XftPatternGetMatrix FcPatternGetMatrix
140:#define XftPatternGetBool   FcPatternGetBool
141:#define XftPatternVaBuild   FcPatternVaBuild
142:#define XftPatternBuild             FcPatternBuild

#556064#25
Date:
2011-02-10 18:41:18 UTC
From:
To:
All those macros are in the XftCompat header though, which seems to
imply that users should use the fontconfig names instead nowadays, and
link to fontconfig themselves?
A similar change is now upstream in libXft 2.2.0 fwiw:
http://cgit.freedesktop.org/xorg/lib/libXft/commit/?id=8751e341bcc29952b4603e18767ab994653c6b01

Cheers,
Julien

#556064#30
Date:
2011-02-10 20:47:15 UTC
From:
To:
I don't see any includes for XftCompat, only Xft.h, in the plt-scheme
code (well the wxxt code they were using) that was failing.
Regardless, plt-scheme (now racket) has removed the code that was
using this, so it doesn't affect me anymore.

Hmm, looking into it, Xft.h includes XftCompat.h unless
_XFT_NO_COMPAT_ is defined and portions of their API still directly
ask for (XftTextExtents*) and return (XftFontMatch) fontconfig types.
If the expectation is that Xft users shouldn't be using either the
XftCompat defines or XftFontMatch and as such don't need to link
against fontconfig, I'm fine with that but it should be called out in
the documentation and noted that doing so does require explicit
linking against fontconfig.  Instead, they're currently taking the
route of providing API compatibility but dropping the required
information to actually build with that compatibility, as I understand
it.