diff options
author | David Tardon <dtardon@redhat.com> | 2017-03-13 16:42:21 +0100 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-12-05 07:45:22 -0500 |
commit | 9e2ea2c9885f1609dcded570d59da3912ca32236 (patch) | |
tree | bafbc417afc62afe0ba9946138bb0d1745fd0fe5 /external/fontconfig | |
parent | upload fontconfig 2.12.1 (diff) | |
download | core-9e2ea2c9885f1609dcded570d59da3912ca32236.tar.gz core-9e2ea2c9885f1609dcded570d59da3912ca32236.zip |
fix fontconfig build with new glibc and gperf
Change-Id: Ia89f068d93b810b0c32df5df62a582322f3e5588
Reviewed-on: https://gerrit.libreoffice.org/35142
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
(cherry picked from commit c0b4bd7409c86addc7971d7810176150c36fbf24)
(cherry picked from commit 9f96fa5be84c620cc93f7ee676b9ba143dd6af02)
Diffstat (limited to 'external/fontconfig')
3 files changed, 166 insertions, 0 deletions
diff --git a/external/fontconfig/0001-Fix-the-build-issue-with-gperf-3.1.patch.1 b/external/fontconfig/0001-Fix-the-build-issue-with-gperf-3.1.patch.1 new file mode 100644 index 000000000000..fe6f44505ffd --- /dev/null +++ b/external/fontconfig/0001-Fix-the-build-issue-with-gperf-3.1.patch.1 @@ -0,0 +1,117 @@ +From 31010a2cc6f2d0596dac640b190df3472e0089dd Mon Sep 17 00:00:00 2001 +From: Akira TAGOH <akira@tagoh.org> +Date: Thu, 23 Feb 2017 21:39:10 +0900 +Subject: [PATCH] Fix the build issue with gperf 3.1 + +To support the one of changes in gperf 3.1: +* The 'len' parameter of the hash function and of the lookup function is now + of type 'size_t' instead of 'unsigned int'. This makes it safe to call these + functions with strings of length > 4 GB, on 64-bit machines. +--- + config.h.in | 3 +++ + configure | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 20 ++++++++++++++++++++ + src/fcobjs.c | 4 ++-- + 4 files changed, 81 insertions(+), 2 deletions(-) + +diff --git a/config.h.in b/config.h.in +index ffff4cd..d5c14a1 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -21,6 +21,9 @@ + /* System font directory */ + #undef FC_DEFAULT_FONTS + ++/* The type of len parameter of the gperf hash/lookup function */ ++#undef FC_GPERF_SIZE_T ++ + /* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like `struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 +diff --git a/configure b/configure +index eed481c..9eddc2b 100755 +--- a/configure ++++ b/configure +@@ -14946,6 +14946,62 @@ _ACEOF + fi + + ++# Check the argument type of the gperf hash/lookup function ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking The type of len parameter of gperf hash/lookup function" >&5 ++$as_echo_n "checking The type of len parameter of gperf hash/lookup function... " >&6; } ++fc_gperf_test="$(echo 'foo' | gperf -L ANSI-C)" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++ #include <string.h> ++ ++ const char *in_word_set(register const char *, register size_t); ++ $fc_gperf_test ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ FC_GPERF_SIZE_T=size_t ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++ #include <string.h> ++ ++ const char *in_word_set(register const char *, register unsigned int); ++ $fc_gperf_test ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ FC_GPERF_SIZE_T="unsigned int" ++else ++ as_fn_error $? "Unable to determine the type of the len parameter of the gperf hash/lookup function" "$LINENO" 5 ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++cat >>confdefs.h <<_ACEOF ++#define FC_GPERF_SIZE_T $FC_GPERF_SIZE_T ++_ACEOF ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC_GPERF_SIZE_T" >&5 ++$as_echo "$FC_GPERF_SIZE_T" >&6; } ++ + # + # Checks for iconv + # +diff --git a/src/fcobjs.c b/src/fcobjs.c +index 16ff31c..33bba8d 100644 +--- a/src/fcobjs.c ++++ b/src/fcobjs.c +@@ -25,10 +25,10 @@ + #include "fcint.h" + + static unsigned int +-FcObjectTypeHash (register const char *str, register unsigned int len); ++FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len); + + static const struct FcObjectTypeInfo * +-FcObjectTypeLookup (register const char *str, register unsigned int len); ++FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len); + + #include "fcobjshash.h" + +-- +2.12.0 + diff --git a/external/fontconfig/UnpackedTarball_fontconfig.mk b/external/fontconfig/UnpackedTarball_fontconfig.mk index 6026a817c5ed..a2d596a327a3 100644 --- a/external/fontconfig/UnpackedTarball_fontconfig.mk +++ b/external/fontconfig/UnpackedTarball_fontconfig.mk @@ -13,6 +13,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,fontconfig,$(FONTCONFIG_TARBALL),,f $(eval $(call gb_UnpackedTarball_add_patches,fontconfig,\ external/fontconfig/fontconfig-2.12.1.patch.1 \ + external/fontconfig/fontconfig-glibc-limits.patch.1 \ + external/fontconfig/0001-Fix-the-build-issue-with-gperf-3.1.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/fontconfig/fontconfig-glibc-limits.patch.1 b/external/fontconfig/fontconfig-glibc-limits.patch.1 new file mode 100644 index 000000000000..8eff16098186 --- /dev/null +++ b/external/fontconfig/fontconfig-glibc-limits.patch.1 @@ -0,0 +1,47 @@ +From 1ab5258f7c2abfafcd63a760ca08bf93591912da Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 14 Dec 2016 16:11:05 -0800 +Subject: [PATCH] Avoid conflicts with integer width macros from TS + 18661-1:2014 + +glibc 2.25+ has now defined these macros in <limits.h> +https://sourceware.org/git/?p=glibc.git;a=commit;h=5b17fd0da62bf923cb61d1bb7b08cf2e1f1f9c1a + +Create an alias for FC_CHAR_WIDTH for ABI compatibility + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + fontconfig/fontconfig.h | 3 ++- + src/fcobjs.h | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h +index 5c72b22..070a557 100644 +--- a/fontconfig/fontconfig.h ++++ b/fontconfig/fontconfig.h +@@ -128,7 +128,8 @@ typedef int FcBool; + #define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION + + /* Adjust outline rasterizer */ +-#define FC_CHAR_WIDTH "charwidth" /* Int */ ++#define FC_CHARWIDTH "charwidth" /* Int */ ++#define FC_CHAR_WIDTH FC_CHARWIDTH + #define FC_CHAR_HEIGHT "charheight"/* Int */ + #define FC_MATRIX "matrix" /* FcMatrix */ + +diff --git a/src/fcobjs.h b/src/fcobjs.h +index 1fc4f65..d27864b 100644 +--- a/src/fcobjs.h ++++ b/src/fcobjs.h +@@ -51,7 +51,7 @@ FC_OBJECT (DPI, FcTypeDouble, NULL) + FC_OBJECT (RGBA, FcTypeInteger, NULL) + FC_OBJECT (SCALE, FcTypeDouble, NULL) + FC_OBJECT (MINSPACE, FcTypeBool, NULL) +-FC_OBJECT (CHAR_WIDTH, FcTypeInteger, NULL) ++FC_OBJECT (CHARWIDTH, FcTypeInteger, NULL) + FC_OBJECT (CHAR_HEIGHT, FcTypeInteger, NULL) + FC_OBJECT (MATRIX, FcTypeMatrix, NULL) + FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet) +-- +2.9.3 + |