summaryrefslogtreecommitdiff
path: root/external/libepubgen
diff options
context:
space:
mode:
Diffstat (limited to 'external/libepubgen')
-rw-r--r--external/libepubgen/UnpackedTarball_libepubgen.mk8
-rw-r--r--external/libepubgen/ubsan-visibility.patch11
2 files changed, 19 insertions, 0 deletions
diff --git a/external/libepubgen/UnpackedTarball_libepubgen.mk b/external/libepubgen/UnpackedTarball_libepubgen.mk
index 5525ca3b2ce7..8d60eccc65fe 100644
--- a/external/libepubgen/UnpackedTarball_libepubgen.mk
+++ b/external/libepubgen/UnpackedTarball_libepubgen.mk
@@ -17,10 +17,18 @@ epubgen_patches += libepubgen-validation3.patch.1
# Backport of <https://sourceforge.net/p/libepubgen/code/ci/49f6461d4751d3b16e32ab8f9c93a3856b33be49/>.
epubgen_patches += libepubgen-vc.patch.1
+ifeq ($(COM_IS_CLANG),TRUE)
+ifneq ($(filter -fsanitize=%,$(CC)),)
+epubgen_patches += ubsan-visibility.patch
+endif
+endif
+
$(eval $(call gb_UnpackedTarball_UnpackedTarball,libepubgen))
$(eval $(call gb_UnpackedTarball_set_tarball,libepubgen,$(EPUBGEN_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libepubgen,0))
+
$(eval $(call gb_UnpackedTarball_add_patches,libepubgen,\
$(foreach patch,$(epubgen_patches),external/libepubgen/$(patch)) \
))
diff --git a/external/libepubgen/ubsan-visibility.patch b/external/libepubgen/ubsan-visibility.patch
new file mode 100644
index 000000000000..10234b308ba5
--- /dev/null
+++ b/external/libepubgen/ubsan-visibility.patch
@@ -0,0 +1,11 @@
+--- configure
++++ configure
+@@ -18425,7 +18425,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden compiler flag" >&5
+ $as_echo_n "checking for -fvisibility=hidden compiler flag... " >&6; }
+ saved_CXXFLAGS="$CXXFLAGS"
+- CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
++ CXXFLAGS="$CXXFLAGS -fvisibility-ms-compat"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+