summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/unxgcc.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 6d89207bf3ee..94526abcdeb4 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -158,9 +158,13 @@ endif
# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10
# we want to use @$(extraobjectlist) in the long run
# link with C compiler if there are no C++ files (pyuno_wrapper depends on this)
+# But always link with C++ compiler e.g. under -fsanitze=undefined, as sal uses
+# __ubsan_handle_dynamic_type_cache_miss_abort and __ubsan_vptr_type_cache from
+# libclang_rt.ubsan_cxx-x86_64.a, and oosplash links against sal but itself only
+# contains .c sources:
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
- $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \
+ $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(gb_CXX),$(gb_CC)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(gb_LTOFLAGS) \
$(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \