summaryrefslogtreecommitdiff
path: root/jurt/Library_jpipe.mk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-09-04 11:51:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-09-04 11:51:54 +0200
commitddc7bb629ade15b3341f2e3c347652c7b8925037 (patch)
treecd3df424eaf6905eec6ac3d182f8621b0209cf21 /jurt/Library_jpipe.mk
parent0ba251fb2b176df7712b9e7c5ef67ff709c022e0 (diff)
Poor hack for libjpipe.so under Clang -fsanitize=*
Change-Id: I5c1036448cfc543f55cf1aa303abcfda6a64f64e
Diffstat (limited to 'jurt/Library_jpipe.mk')
-rw-r--r--jurt/Library_jpipe.mk45
1 files changed, 44 insertions, 1 deletions
diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk
index 44d502499eca..2ca6cb7b019b 100644
--- a/jurt/Library_jpipe.mk
+++ b/jurt/Library_jpipe.mk
@@ -21,7 +21,7 @@ $(eval $(call gb_Library_add_cobjects,jpipe,\
jurt/source/pipe/wrapper/wrapper \
))
-else
+else ifeq ($(COM_GCC_IS_CLANG)$(filter -fsanitize=%,%(gb_CC)),)
$(eval $(call gb_Library_use_libraries,jpipe,\
sal \
@@ -31,6 +31,49 @@ $(eval $(call gb_Library_add_cobjects,jpipe,\
jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection \
))
+else
+
+# HACK for Clang -fsanitize=address etc. to build libjpipe.so (dlopen'ed from
+# java executable) without dependence on __asan_* etc. symbols (expected to be
+# provided by the executable), incl. statically linking in the relevant parts of
+# sal:
+
+$(eval $(call gb_Library_add_cobjects,jpipe, \
+ jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection \
+ jurt/source/pipe/staticsalhack_c \
+))
+
+$(eval $(call gb_Library_add_exception_objects,jpipe, \
+ jurt/source/pipe/staticsalhack_cxx \
+))
+
+$(eval $(call gb_Library_add_defs,jpipe, \
+ -DRTL_OS="\"$(RTL_OS)"\" \
+ -DRTL_ARCH="\"$(RTL_ARCH)"\" \
+))
+
+$(eval $(call gb_Library_set_include,jpipe, \
+ $$(INCLUDE) \
+ -I$(SRCDIR) \
+ -I$(SRCDIR)/sal/inc \
+ -I$(SRCDIR)/sal/osl/unx \
+ -I$(SRCDIR)/sal/rtl \
+ -I$(SRCDIR)/sal/textenc \
+))
+
+$(eval $(call gb_Library_use_externals,jpipe, \
+ boost_headers \
+))
+
+$(eval $(call gb_Library_add_libs,jpipe, \
+ $(if $(filter-out $(OS),ANDROID),-lpthread) \
+))
+
+$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
+ gb_CC := $(filter-out -fsanitize=%,$(gb_CC))
+$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
+ gb_CXX := $(filter-out -fsanitize=%,$(gb_CXX))
+
endif
# vim:set noet sw=4 ts=4: