summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-19 15:27:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-05-19 15:27:51 +0200
commitfd2c99e473fabf811a909be9b11b7dbe19f2814e (patch)
tree2c35670cc6dd2599b5a0249409a2e327ed200d5c /external
parentab216f7039d473a4e7b6c08d868d4dc376161539 (diff)
external/harfbuzz: work around -fsanitize=function
Change-Id: I8e107c155a99fd68b0aa054435bc85246444b3c6
Diffstat (limited to 'external')
-rw-r--r--external/harfbuzz/UnpackedTarball_harfbuzz.mk4
-rw-r--r--external/harfbuzz/ubsan.patch32
2 files changed, 36 insertions, 0 deletions
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 5450a81ba0ed..9a5560fda96f 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,harfbuzz,$(HARFBUZZ_TARBALL),,harfb
$(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
+$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
+ external/harfbuzz/ubsan.patch \
+))
+
ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
external/harfbuzz/harfbuzz-rtti.patch \
diff --git a/external/harfbuzz/ubsan.patch b/external/harfbuzz/ubsan.patch
new file mode 100644
index 000000000000..1375c9d71f95
--- /dev/null
+++ b/external/harfbuzz/ubsan.patch
@@ -0,0 +1,32 @@
+--- src/hb-ot-map-private.hh
++++ src/hb-ot-map-private.hh
+@@ -52,8 +52,11 @@
+ unsigned int needs_fallback : 1;
+ unsigned int auto_zwj : 1;
+
+- static int cmp (const feature_map_t *a, const feature_map_t *b)
+- { return a->tag < b->tag ? -1 : a->tag > b->tag ? 1 : 0; }
++ static int cmp (void const * a_, void const * b_) {
++ feature_map_t const * a = static_cast<feature_map_t const *>(a_);
++ feature_map_t const * b = static_cast<feature_map_t const *>(b_);
++ return a->tag < b->tag ? -1 : a->tag > b->tag ? 1 : 0;
++ }
+ };
+
+ struct lookup_map_t {
+--- src/hb-ot-tag.cc
++++ src/hb-ot-tag.cc
+@@ -778,9 +778,11 @@
+ };
+
+ static int
+-lang_compare_first_component (const char *a,
+- const char *b)
++lang_compare_first_component (void const * a_,
++ void const * b_)
+ {
++ char const * a = static_cast<char const *>(a_);
++ char const * b = static_cast<char const *>(b_);
+ unsigned int da, db;
+ const char *p;
+