[HarfBuzz] harfbuzz: Branch 'master' - 4 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Sep 27 21:20:45 UTC 2018


 .circleci/config.yml         |    2 +-
 src/harfbuzz-config.cmake.in |    4 ++++
 src/hb-atomic.hh             |    7 +++++--
 src/hb-cache.hh              |    5 ++++-
 4 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 3ee96984f4633852736b33640c89d1706bc77e0b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 27 17:20:26 2018 -0400

    Fixup atomics from recent change

diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh
index 8bc94039..6f9d6ec2 100644
--- a/src/hb-atomic.hh
+++ b/src/hb-atomic.hh
@@ -84,9 +84,9 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N)
 
 #define hb_atomic_int_impl_add(AI, V)		(reinterpret_cast<std::atomic<int> *> (AI)->fetch_add ((V), std::memory_order_acq_rel))
 #define hb_atomic_int_impl_set_relaxed(AI, V)	(reinterpret_cast<std::atomic<int> *> (AI)->store ((V), std::memory_order_relaxed))
-#define hb_atomic_int_impl_set_relaxed(AI, V)	(reinterpret_cast<std::atomic<int> *> (AI)->store ((V), std::memory_order_release))
+#define hb_atomic_int_impl_set(AI, V)		(reinterpret_cast<std::atomic<int> *> (AI)->store ((V), std::memory_order_release))
 #define hb_atomic_int_impl_get_relaxed(AI)	(reinterpret_cast<std::atomic<int> *> (AI)->load (std::memory_order_relaxed))
-#define hb_atomic_int_impl_get_relaxed(AI)	(reinterpret_cast<std::atomic<int> *> (AI)->load (std::memory_order_acquire))
+#define hb_atomic_int_impl_get(AI)		(reinterpret_cast<std::atomic<int> *> (AI)->load (std::memory_order_acquire))
 
 #define hb_atomic_ptr_impl_set_relaxed(P, V)	(reinterpret_cast<std::atomic<void*> *> (P)->store ((V), std::memory_order_relaxed))
 #define hb_atomic_ptr_impl_get_relaxed(P)	(reinterpret_cast<std::atomic<void*> *> (P)->load (std::memory_order_relaxed))
@@ -253,6 +253,9 @@ static_assert ((sizeof (long) == sizeof (void *)), "");
 #ifndef hb_atomic_ptr_impl_get_relaxed
 #define hb_atomic_ptr_impl_get_relaxed(P)	(*(P))
 #endif
+#ifndef hb_atomic_int_impl_set
+inline void hb_atomic_int_impl_get (int *AI, int v)	{ _hb_memory_w_barrier (); *AI = v; }
+#endif
 #ifndef hb_atomic_int_impl_get
 inline int hb_atomic_int_impl_get (int *AI)	{ int v = *AI; _hb_memory_r_barrier (); return v; }
 #endif
commit 305468708dc9ce9dadad36c117c380f13bcc6a26
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 27 16:54:23 2018 -0400

    [cache] Use atomic writes in clear()
    
    To help TSan.

diff --git a/src/hb-cache.hh b/src/hb-cache.hh
index f8581b4d..ec2e8635 100644
--- a/src/hb-cache.hh
+++ b/src/hb-cache.hh
@@ -42,7 +42,10 @@ struct hb_cache_t
   inline void fini (void) {}
 
   inline void clear (void)
-  { memset (values, 255, sizeof (values)); }
+  {
+    for (unsigned i = 0; i < ARRAY_LENGTH (values); i++)
+      values[i].set_relaxed (-1);
+  }
 
   inline bool get (unsigned int key, unsigned int *value) const
   {
commit 9e9a36ee651502b69717895385387951a2d0802a
Author: Volker Krause <vkrause at kde.org>
Date:   Thu Sep 27 16:33:49 2018 +0200

    Fix infinite loop when walking up the directory hierarchy (#1183)
    
    A single find_package(harfbuzz) line in user code resulted in this loop
    getting stuck when _harfbuzz_libdir_iter became "/".

diff --git a/src/harfbuzz-config.cmake.in b/src/harfbuzz-config.cmake.in
index 87b15721..304410d9 100644
--- a/src/harfbuzz-config.cmake.in
+++ b/src/harfbuzz-config.cmake.in
@@ -12,7 +12,11 @@ set(_harfbuzz_libdir "@libdir@")
 string(REPLACE "${_harfbuzz_remove_string}/" "" _harfbuzz_libdir "${_harfbuzz_libdir}")
 set(_harfbuzz_libdir_iter "${_harfbuzz_libdir}")
 while (_harfbuzz_libdir_iter)
+  set(_harfbuzz_libdir_prev_iter "${_harfbuzz_libdir_iter}")
   get_filename_component(_harfbuzz_libdir_iter "${_harfbuzz_libdir_iter}" DIRECTORY)
+  if (_harfbuzz_libdir_prev_iter STREQUAL _harfbuzz_libdir_iter)
+    break()
+  endif ()
   get_filename_component(_harfbuzz_prefix "${_harfbuzz_prefix}" DIRECTORY)
 endwhile ()
 unset(_harfbuzz_libdir_iter)
commit 0c1d852bc41a4f69f890be4817c84bd7de56e07a
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Thu Sep 27 11:53:17 2018 +0330

    Use clang for compiling freetype for tsan bot

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 97d211bc..c3271599 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -139,7 +139,7 @@ jobs:
       - run: apt update || true
       - run: apt install -y clang lld binutils libtool autoconf automake make pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip
       - run: pip install fonttools
-      - run: wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2 && tar xf freetype-2.9.tar.bz2 && cd freetype-2.9 && CPPFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" ./autogen.sh && ./configure && make -j4 && cd ..
+      - run: wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2 && tar xf freetype-2.9.tar.bz2 && cd freetype-2.9 && CPPFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" LD=ld.lld CC=clang CXX=clang++ ./autogen.sh && ./configure && make -j4 && cd ..
       - run: CPPFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=thread -O1 -g -fno-omit-frame-pointer" LD=ld.lld CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2
       - run: make
       - run: LD_LIBRARY_PATH="$PWD/freetype-2.9/objs/.libs" make check || .ci/fail.sh | asan_symbolize | c++filt


More information about the HarfBuzz mailing list