Bug 52573 - patch required to build 2.10.x with oldish GNU C library headers
Summary: patch required to build 2.10.x with oldish GNU C library headers
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: fc-cache (show other bugs)
Version: 2.9
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Akira TAGOH
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-27 08:27 UTC by Peter Breitenlohner
Modified: 2012-09-11 09:01 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch for oldish GNU C Library to have posix_fadvise() declared (436 bytes, application/octet-stream)
2012-07-27 08:27 UTC, Peter Breitenlohner
Details

Description Peter Breitenlohner 2012-07-27 08:27:27 UTC
Created attachment 64766 [details]
patch for oldish GNU C Library to have posix_fadvise() declared

In order to build 2.9.91 or later for (32- or 64-bit) Linux-x86, using the GNU C Library headers from the admittedly somewhat oldish version 2.3.6 I had to apply the attached patch.  Without that patch the declaration of posix_fadvise() was missing.
Comment 1 Akira TAGOH 2012-07-27 09:21:00 UTC
Hm, it looks not correct to me. probably you should include feature.h and define _XOPEN_SOURCE or _POSIX_C_SOURCE with proper value instead if any.
Comment 2 Peter Breitenlohner 2012-07-27 11:09:11 UTC
You are absolutely right and and that is indeed what I tried first.  To be precise I had passed 'CPPFLAGS=-D_XOPEN_SOURCE=600' to configure, but that didn't help.

<features.h> is already included automatically via <stdlib.h>.

Part of the problem clearly is that configure detects the function but does not realize the missing declaration.  IMHO that is a weakness of your configure.ac.

Doing some experiments, I found that defining _GNU_SOURCE was the only thing that did help (e.g., via CPPFLAGS passed to configure).
Comment 3 Akira TAGOH 2012-07-27 13:44:50 UTC
(In reply to comment #2)
> Part of the problem clearly is that configure detects the function but does not
> realize the missing declaration.  IMHO that is a weakness of your configure.ac.

Right. i'll try to improve it later.

> Doing some experiments, I found that defining _GNU_SOURCE was the only thing
> that did help (e.g., via CPPFLAGS passed to configure).

Okay, let me try. thanks for reporting.
Comment 4 Akira TAGOH 2012-08-07 10:24:38 UTC
Hm, apparently _POSIX_C_SOURCE is less than 200112L on older glibc, even though defining _XOPEN_SOURCE.

Having said that a hack is still needed to get things done though.
Comment 5 Akira TAGOH 2012-08-31 07:31:26 UTC
Proposed fix is in this tree:
  http://cgit.freedesktop.org/~tagoh/fontconfig/log/?h=bz52573

Please test if it works for you.
Comment 6 Akira TAGOH 2012-09-11 09:01:11 UTC
Okay, confirmed the patch works with glibc 2.3.4, after clean up a bit. merged into master.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.