[Libreoffice-commits] core.git: external/firebird
Stephan Bergmann
sbergman at redhat.com
Fri Dec 22 19:32:29 UTC 2017
external/firebird/UnpackedTarball_firebird.mk | 8 ++++
external/firebird/sanitizer.patch | 52 ++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
New commits:
commit 6a312a4a3d642f0f9769df54c0ec25471c9916bd
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Dec 22 07:58:47 2017 +0100
Prepare external/firebird for sanitizers
...so at least Clang -fsanitize=function on Linux works now. The patch needs to
stop errors about undefined sanitizer symbols in DSOs (UNDEF_PLATFORM,
EXE_LINK_OPTIONS), and make resolution of RTTI symbols consistent in a process,
by exporting them from the various version map files and adding RTLD_GLOBAL to
dlopen.
Change-Id: I75779e55529b62a96a8943e3dee9119647aa91a7
Reviewed-on: https://gerrit.libreoffice.org/46947
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk
index 9c03f7c8755f..a055b6573696 100644
--- a/external/firebird/UnpackedTarball_firebird.mk
+++ b/external/firebird/UnpackedTarball_firebird.mk
@@ -46,4 +46,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\
))
endif
+ifeq ($(COM_IS_CLANG),TRUE)
+ifneq ($(filter -fsanitize=%,$(CC)),)
+$(eval $(call gb_UnpackedTarball_add_patches,firebird, \
+ external/firebird/sanitizer.patch \
+))
+endif
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/firebird/sanitizer.patch b/external/firebird/sanitizer.patch
new file mode 100644
index 000000000000..cf3a54b266f8
--- /dev/null
+++ b/external/firebird/sanitizer.patch
@@ -0,0 +1,52 @@
+--- builds/posix/fbintl.vers
++++ builds/posix/fbintl.vers
+@@ -29,3 +29,4 @@
+ LD_lookup_texttype
+ LD_setup_attributes
+ LD_version
++_ZTI*
+--- builds/posix/fbplugin.vers
++++ builds/posix/fbplugin.vers
+@@ -26,3 +26,4 @@
+ #
+
+ firebird_plugin
++_ZTI*
+--- builds/posix/firebird.vers
++++ builds/posix/firebird.vers
+@@ -367,3 +367,4 @@
+
+ KEYWORD_stringIsAToken
+ KEYWORD_getTokens
++_ZTI*
+--- builds/posix/make.defaults
++++ builds/posix/make.defaults
+@@ -252,7 +252,7 @@
+ # LINKER OPTIONS
+ #
+
+-UNDEF_PLATFORM = -Wl,--no-undefined
++UNDEF_PLATFORM =
+ ifeq ($(TARGET),Debug)
+ UNDEF_FLAGS = $(UNDEF_PLATFORM)
+ endif
+@@ -291,7 +291,7 @@
+ LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
+ FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB)
+
+-EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
++EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS)
+ LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
+
+ FB_DAEMON = $(BIN)/firebird$(EXEC_EXT)
+--- src/common/os/posix/mod_loader.cpp
++++ src/common/os/posix/mod_loader.cpp
+@@ -88,7 +88,7 @@
+
+ ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath)
+ {
+- void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE);
++ void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE | RTLD_GLOBAL);
+ if (module == NULL)
+ {
+ #ifdef DEV_BUILD
More information about the Libreoffice-commits
mailing list