[Libreoffice-commits] core.git: download.lst external/harfbuzz

Khaled Hosny khaledhosny at eglug.org
Wed Nov 15 00:20:11 UTC 2017


 download.lst                                  |    4 
 external/harfbuzz/UnpackedTarball_harfbuzz.mk |    1 
 external/harfbuzz/revert-make-inert.patch     |  200 ++++++++++++++++++++++++++
 3 files changed, 203 insertions(+), 2 deletions(-)

New commits:
commit 7e56dce9efa7184e522c83130dcf79d894488657
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Mon Nov 13 21:18:47 2017 +0200

    tdf#105992: Upload HarfBuzz 1.7.0
    
    This release supports old-style kern table in the code path we are using in
    CommonLayout.
    
    Change-Id: Id20e6fe1cfe98ef65b8fa4a5627f6246cbac54a6
    Reviewed-on: https://gerrit.libreoffice.org/44693
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/download.lst b/download.lst
index 51553c95a7fe..78bac45c9514 100644
--- a/download.lst
+++ b/download.lst
@@ -84,8 +84,8 @@ export GPGME_SHA256SUM := 1b29fedb8bfad775e70eafac5b0590621683b2d9869db994568e64
 export GPGME_TARBALL := gpgme-1.9.0.tar.bz2
 export GRAPHITE_SHA256SUM := aa5e58356cd084000609ebbd93fef456a1bc0ab9e46fea20e81552fb286232a9
 export GRAPHITE_TARBALL := graphite2-minimal-1.3.10.tgz
-export HARFBUZZ_SHA256SUM := e31eb367beb61a9399d2c78b51c225ab2b1cbd46f364f2d80d97bb422b44101a
-export HARFBUZZ_TARBALL := harfbuzz-1.6.3.tar.bz2
+export HARFBUZZ_SHA256SUM := 042742d6ec67bc6719b69cf38a3fba24fbd120e207e3fdc18530dc730fb6a029
+export HARFBUZZ_TARBALL := harfbuzz-1.7.0.tar.bz2
 export HSQLDB_SHA256SUM := d30b13f4ba2e3b6a2d4f020c0dee0a9fb9fc6fbcc2d561f36b78da4bf3802370
 export HSQLDB_TARBALL := 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
 export HUNSPELL_SHA256SUM := 3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce180cac4d6f4c4
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 74c990c0c1aa..537862531bfd 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
 $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
     external/harfbuzz/clang-cl.patch \
     external/harfbuzz/ubsan.patch \
+	external/harfbuzz/revert-make-inert.patch \
 ))
 
 ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
diff --git a/external/harfbuzz/revert-make-inert.patch b/external/harfbuzz/revert-make-inert.patch
new file mode 100644
index 000000000000..366750d87fb9
--- /dev/null
+++ b/external/harfbuzz/revert-make-inert.patch
@@ -0,0 +1,200 @@
+From 93f7c1652a05e806c2e3ac7edf498d2f4a508a3a Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <behdad at behdad.org>
+Date: Tue, 14 Nov 2017 10:59:54 -0800
+Subject: [PATCH] Revert "[glib/ucdn/icu/ft/ot] Make returned funcs inert"
+
+This reverts commit 5daf3bd4494cce6b4fb074533be9e99c4d9e0edd.
+
+If other atexit callbacks try to destruct the objects we destruct
+in atexit callbacks, bad things will happen.
+
+I'll come up with some other way to catch premature destruction
+of HB-owned objects.
+
+Fixes https://github.com/behdad/harfbuzz/issues/618
+---
+ src/hb-ft.cc             |  3 ---
+ src/hb-glib.cc           |  3 ---
+ src/hb-icu.cc            |  3 ---
+ src/hb-object-private.hh | 37 ++++++-------------------------------
+ src/hb-ot-font.cc        |  3 ---
+ src/hb-ucdn.cc           |  3 ---
+ 6 files changed, 6 insertions(+), 46 deletions(-)
+
+diff --git src/hb-ft.cc src/hb-ft.cc
+index 68c774547..0f15f8c3d 100644
+--- src/hb-ft.cc
++++ src/hb-ft.cc
+@@ -423,7 +423,6 @@ static hb_font_funcs_t *static_ft_funcs = nullptr;
+ static
+ void free_static_ft_funcs (void)
+ {
+-  hb_object_undo_inert (static_ft_funcs);
+   hb_font_funcs_destroy (static_ft_funcs);
+ }
+ #endif
+@@ -454,10 +453,8 @@ _hb_ft_font_set_funcs (hb_font_t *font, FT_Face ft_face, bool unref)
+     hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, nullptr, nullptr);
+ 
+     hb_font_funcs_make_immutable (funcs);
+-    hb_object_make_inert (funcs);
+ 
+     if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, nullptr, funcs)) {
+-      hb_object_undo_inert (funcs);
+       hb_font_funcs_destroy (funcs);
+       goto retry;
+     }
+diff --git src/hb-glib.cc src/hb-glib.cc
+index 31de68e86..50c30e9c7 100644
+--- src/hb-glib.cc
++++ src/hb-glib.cc
+@@ -370,7 +370,6 @@ static hb_unicode_funcs_t *static_glib_funcs = nullptr;
+ static
+ void free_static_glib_funcs (void)
+ {
+-  hb_object_undo_inert (static_glib_funcs);
+   hb_unicode_funcs_destroy (static_glib_funcs);
+ }
+ #endif
+@@ -391,10 +390,8 @@ hb_glib_get_unicode_funcs (void)
+ #undef HB_UNICODE_FUNC_IMPLEMENT
+ 
+     hb_unicode_funcs_make_immutable (funcs);
+-    hb_object_make_inert (funcs);
+ 
+     if (!hb_atomic_ptr_cmpexch (&static_glib_funcs, nullptr, funcs)) {
+-      hb_object_undo_inert (funcs);
+       hb_unicode_funcs_destroy (funcs);
+       goto retry;
+     }
+diff --git src/hb-icu.cc src/hb-icu.cc
+index 44a198937..552eaeca5 100644
+--- src/hb-icu.cc
++++ src/hb-icu.cc
+@@ -351,7 +351,6 @@ static hb_unicode_funcs_t *static_icu_funcs = nullptr;
+ static
+ void free_static_icu_funcs (void)
+ {
+-  hb_object_undo_inert (static_icu_funcs);
+   hb_unicode_funcs_destroy (static_icu_funcs);
+ }
+ #endif
+@@ -380,10 +379,8 @@ hb_icu_get_unicode_funcs (void)
+ #undef HB_UNICODE_FUNC_IMPLEMENT
+ 
+     hb_unicode_funcs_make_immutable (funcs);
+-    hb_object_make_inert (funcs);
+ 
+     if (!hb_atomic_ptr_cmpexch (&static_icu_funcs, nullptr, funcs)) {
+-      hb_object_undo_inert (funcs);
+       hb_unicode_funcs_destroy (funcs);
+       goto retry;
+     }
+diff --git src/hb-object-private.hh src/hb-object-private.hh
+index 0dada492c..baa1f8f05 100644
+--- src/hb-object-private.hh
++++ src/hb-object-private.hh
+@@ -41,10 +41,9 @@
+ 
+ /* reference_count */
+ 
+-#define HB_REFERENCE_COUNT_UNCHANGABLE_VALUE	-0x53043
+-#define HB_REFERENCE_COUNT_UNREFFABLE_VALUE	-0x07734
+-#define HB_REFERENCE_COUNT_UNTOUCHABLE_VALUE	-0xBEDAD
+-#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT (HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)}
++#define HB_REFERENCE_COUNT_INERT_VALUE -1
++#define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD
++#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)}
+ 
+ struct hb_reference_count_t
+ {
+@@ -54,23 +53,9 @@ struct hb_reference_count_t
+   inline int get_unsafe (void) const { return ref_count.get_unsafe (); }
+   inline int inc (void) { return ref_count.inc (); }
+   inline int dec (void) { return ref_count.dec (); }
+-  inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_UNTOUCHABLE_VALUE); }
+-
+-  inline void make_inert (void)
+-  {
+-    if (get_unsafe () == HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)
+-      return;
+-    ref_count.set_unsafe (HB_REFERENCE_COUNT_UNREFFABLE_VALUE);
+-  }
+-  inline void undo_inert (void)
+-  {
+-    if (get_unsafe () == HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)
+-      return;
+-    assert (get_unsafe () == HB_REFERENCE_COUNT_UNREFFABLE_VALUE);
+-    ref_count.set_unsafe (1);
+-  }
+-
+-  inline bool is_inert (void) const { return ref_count.get_unsafe () < 0; }
++  inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); }
++
++  inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; }
+   inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; }
+ };
+ 
+@@ -161,16 +146,6 @@ static inline bool hb_object_is_valid (const Type *obj)
+   return likely (obj->header.ref_count.is_valid ());
+ }
+ template <typename Type>
+-static inline void hb_object_make_inert (Type *obj)
+-{
+-  obj->header.ref_count.make_inert ();
+-}
+-template <typename Type>
+-static inline void hb_object_undo_inert (Type *obj)
+-{
+-  obj->header.ref_count.undo_inert ();
+-}
+-template <typename Type>
+ static inline Type *hb_object_reference (Type *obj)
+ {
+   hb_object_trace (obj, HB_FUNC);
+diff --git src/hb-ot-font.cc src/hb-ot-font.cc
+index 72d3c5836..47416012c 100644
+--- src/hb-ot-font.cc
++++ src/hb-ot-font.cc
+@@ -663,7 +663,6 @@ static hb_font_funcs_t *static_ot_funcs = nullptr;
+ static
+ void free_static_ot_funcs (void)
+ {
+-  hb_object_undo_inert (static_ot_funcs);
+   hb_font_funcs_destroy (static_ot_funcs);
+ }
+ #endif
+@@ -694,10 +693,8 @@ _hb_ot_get_font_funcs (void)
+     hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, nullptr, nullptr);
+ 
+     hb_font_funcs_make_immutable (funcs);
+-    hb_object_make_inert (funcs);
+ 
+     if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, nullptr, funcs)) {
+-      hb_object_undo_inert (funcs);
+       hb_font_funcs_destroy (funcs);
+       goto retry;
+     }
+diff --git src/hb-ucdn.cc src/hb-ucdn.cc
+index 99266724f..9515bda25 100644
+--- src/hb-ucdn.cc
++++ src/hb-ucdn.cc
+@@ -237,7 +237,6 @@ static hb_unicode_funcs_t *static_ucdn_funcs = nullptr;
+ static
+ void free_static_ucdn_funcs (void)
+ {
+-  hb_object_undo_inert (static_ucdn_funcs);
+   hb_unicode_funcs_destroy (static_ucdn_funcs);
+ }
+ #endif
+@@ -259,10 +258,8 @@ hb_ucdn_get_unicode_funcs (void)
+ #undef HB_UNICODE_FUNC_IMPLEMENT
+ 
+     hb_unicode_funcs_make_immutable (funcs);
+-    hb_object_make_inert (funcs);
+ 
+     if (!hb_atomic_ptr_cmpexch (&static_ucdn_funcs, nullptr, funcs)) {
+-      hb_object_undo_inert (funcs);
+       hb_unicode_funcs_destroy (funcs);
+       goto retry;
+     }


More information about the Libreoffice-commits mailing list