GNU bug report logs - #49722
27.2; Emacs won't build with old versions of fontconfig

Previous Next

Package: emacs;

Reported by: Andrei Kuznetsov <r12451428287 <at> 163.com>

Date: Sat, 24 Jul 2021 16:32:02 UTC

Severity: normal

Found in version 27.2

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49722 in the body.
You can then email your comments to 49722 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Sat, 24 Jul 2021 16:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrei Kuznetsov <r12451428287 <at> 163.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 24 Jul 2021 16:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrei Kuznetsov <r12451428287 <at> 163.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.2; Emacs won't build with old versions of fontconfig
Date: Sat, 24 Jul 2021 18:01:03 +0800
I was unable to build Emacs 27.2 on a system with some old version
(2.5.0) of fontconfig without applying the following patch:

diff -u a/emacs-27.2/src/xftfont.c b/emacs-27.2/src/xftfont.c
--- a/emacs-27.2/src/xftfont.c
+++ b/emacs-27.2/src/xftfont.c
@@ -588,8 +588,10 @@
   r1 = FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i1);
   r2 = FcPatternGetInteger (oldpat, FC_HINT_STYLE, 0, &i2);
   if (r1 != r2 || i1 != i2) goto out;
+#ifdef FC_LCD_FILTER
   r1 = FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &i1);
   r2 = FcPatternGetInteger (oldpat, FC_LCD_FILTER, 0, &i2);
+#endif
   if (r1 != r2 || i1 != i2) goto out;
   r1 = FcPatternGetInteger (pat, FC_RGBA, 0, &i1);
   r2 = FcPatternGetInteger (oldpat, FC_RGBA, 0, &i2);

Diff finished.  Sat Jul 24 14:26:32 2021

The system on which the bug was discovered runs Fedora Core 9, but it
should be reproducible by building Emacs with Xft on a system with
fontconfig older than 2.6.0 (and possibly newer -- I am not sure on
that).

In GNU Emacs 27.2 (build 1, powerpc-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2021-07-24 built on distributor-machine
Windowing system distributor 'The X.Org Foundation', version 11.0.12101001
System Description: Fedora release 9 (Sulphur)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --prefix=/usr/local --with-gnutls=no'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GCONF GLIB ACL
LIBSELINUX LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE
XIM MODULES THREADS PDUMPER

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x
cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 8 44357 8801)
 (symbols 24 5958 1)
 (strings 16 16066 1889)
 (string-bytes 1 512783)
 (vectors 8 9285)
 (vector-slots 4 137016 13736)
 (floats 8 21 50)
 (intervals 28 202 7)
 (buffers 576 11)
 (heap 1024 3934 455))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Sat, 24 Jul 2021 16:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 49722 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrei Kuznetsov <r12451428287 <at> 163.com>
Cc: 49722 <at> debbugs.gnu.org
Subject: Re: bug#49722: 27.2; Emacs won't build with old versions of fontconfig
Date: Sat, 24 Jul 2021 19:37:42 +0300
> From: Andrei Kuznetsov <r12451428287 <at> 163.com>
> Date: Sat, 24 Jul 2021 18:01:03 +0800
> 
> I was unable to build Emacs 27.2 on a system with some old version
> (2.5.0) of fontconfig without applying the following patch:

Thanks, but please show the error messages you saw before applying
that patch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Sun, 25 Jul 2021 01:06:02 GMT) Full text and rfc822 format available.

Message #11 received at 49722 <at> debbugs.gnu.org (full text, mbox):

From: Andrei Kuznetsov <r12451428287 <at> 163.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 49722 <at> debbugs.gnu.org
Subject: Re: bug#49722: 27.2; Emacs won't build with old versions of fontconfig
Date: Sun, 25 Jul 2021 08:53:59 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, but please show the error messages you saw before applying
> that patch.

xftfont.c: In function ‘xftfont_cached_font_ok’:
xftfont.c:591: error: ‘FC_LCD_FILTER’ undeclared (first use in this function)
xftfont.c:591: error: (Each undeclared identifier is reported only once
xftfont.c:591: error: for each function it appears in.)

It appears that FC_LCD_FILTER is not present on these older versions of
fontconfig.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Sun, 25 Jul 2021 06:44:01 GMT) Full text and rfc822 format available.

Message #14 received at 49722 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrei Kuznetsov <r12451428287 <at> 163.com>
Cc: 49722 <at> debbugs.gnu.org
Subject: Re: bug#49722: 27.2; Emacs won't build with old versions of fontconfig
Date: Sun, 25 Jul 2021 09:43:01 +0300
> From: Andrei Kuznetsov <r12451428287 <at> 163.com>
> Cc: 49722 <at> debbugs.gnu.org
> Date: Sun, 25 Jul 2021 08:53:59 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks, but please show the error messages you saw before applying
> > that patch.
> 
> xftfont.c: In function ‘xftfont_cached_font_ok’:
> xftfont.c:591: error: ‘FC_LCD_FILTER’ undeclared (first use in this function)
> xftfont.c:591: error: (Each undeclared identifier is reported only once
> xftfont.c:591: error: for each function it appears in.)
> 
> It appears that FC_LCD_FILTER is not present on these older versions of
> fontconfig.

Thanks.  We once had the following in xftfont.c:

  #ifndef FC_LCD_FILTER
    /* Older fontconfig versions don't have FC_LCD_FILTER. */
  #define FC_LCD_FILTER "lcdfilter"
  #endif

But it got moved to ftfont.c when a function which used it was moved
there.  However, since xftfont.c still uses this, I think we should
have this #define in xftfont.c as well, so please try adding that at
the beginning of xftfont.c, and see if that helps.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Sun, 25 Jul 2021 15:36:02 GMT) Full text and rfc822 format available.

Message #17 received at 49722 <at> debbugs.gnu.org (full text, mbox):

From: Andrei Kuznetsov <r12451428287 <at> 163.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 49722 <at> debbugs.gnu.org
Subject: Re: bug#49722: 27.2; Emacs won't build with old versions of fontconfig
Date: Sun, 25 Jul 2021 19:28:34 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> However, since xftfont.c still uses this, I think we should
> have this #define in xftfont.c as well, so please try adding that at
> the beginning of xftfont.c, and see if that helps.

Indeed it does.  With the aformentioned change, Emacs now builds and
seems to operate normally.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49722; Package emacs. (Fri, 05 Nov 2021 14:15:02 GMT) Full text and rfc822 format available.

Message #20 received at 49722 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Andrei Kuznetsov <r12451428287 <at> 163.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 49722 <at> debbugs.gnu.org
Subject: Re: bug#49722: 27.2; Emacs won't build with old versions of fontconfig
Date: Fri, 5 Nov 2021 07:14:10 -0700
close 49722 28.1
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> xftfont.c: In function ‘xftfont_cached_font_ok’:
>> xftfont.c:591: error: ‘FC_LCD_FILTER’ undeclared (first use in this function)
>> xftfont.c:591: error: (Each undeclared identifier is reported only once
>> xftfont.c:591: error: for each function it appears in.)
>>
>> It appears that FC_LCD_FILTER is not present on these older versions of
>> fontconfig.
>
> Thanks.  We once had the following in xftfont.c:
>
>   #ifndef FC_LCD_FILTER
>     /* Older fontconfig versions don't have FC_LCD_FILTER. */
>   #define FC_LCD_FILTER "lcdfilter"
>   #endif
>
> But it got moved to ftfont.c when a function which used it was moved
> there.  However, since xftfont.c still uses this, I think we should
> have this #define in xftfont.c as well, so please try adding that at
> the beginning of xftfont.c, and see if that helps.

Andrei Kuznetsov <r12451428287 <at> 163.com> writes:

> Indeed it does.  With the aformentioned change, Emacs now builds and
> seems to operate normally.

The fix was installed, so I'm closing this bug report.

commit 41a55a330f518254da795719ac6e3085254d4110
Author: Eli Zaretskii <eliz <at> gnu.org>
Date:   Sun Jul 25 15:50:46 2021 +0300

    Fix compilation of xftfont.c with old fontconfig

    * src/xftfont.c (FC_LCD_FILTER): Define if undefined, for older
    versions of fontconfig.  This was mistakenly deleted 2 years ago.
    (Bug#49722)




bug marked as fixed in version 28.1, send any further explanations to 49722 <at> debbugs.gnu.org and Andrei Kuznetsov <r12451428287 <at> 163.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 05 Nov 2021 14:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.