office-gobmx/external/libcdr/UnpackedTarball_libcdr.mk
Stephan Bergmann f0aa1a78fb For Clang -fsanitize=vptr use -fvisibility-ms-compat, not -fvisibility=hidden
As discussed in b4f6b26b5a "SAL_DLLPUBLIC_RTTI for
proper RTTI visibility for LLVM," RTTI-based -fsanitize= checks with Clang on
Linux need special precautions to make RTTI symbols visible across DSOs.  The
approach taken there, as well as in 598d8194b0
"Visible function type RTTI for Clang -fsanitize=function," was to add explicit
SAL_DLLPUBLIC_RTTI annontations to relevant type definitions.  However, for
-fsanitize=vptr that would have required many more of those, so it appears
easier to "misuse" -fsanitize-ms-compat in that case, which happens to give all
RTTI symbols default visibility (while otherwise still honoring our
SAL_DLLPUBLIC/PRIVATE annotations).

The SAL_DLLPUBLIC_RTTI annotations from 598d8194b0
"Visible function type RTTI for Clang -fsanitize=function" can likely be removed
again.

Change-Id: Ibeff7ab8c908111a7dc66ff0677204f112b24db8
2015-02-27 10:05:22 +01:00

24 lines
722 B
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,libcdr))
$(eval $(call gb_UnpackedTarball_set_tarball,libcdr,$(CDR_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,libcdr,0))
ifeq ($(COM_GCC_IS_CLANG),TRUE)
ifneq ($(filter -fsanitize=%,$(CC)),)
$(eval $(call gb_UnpackedTarball_add_patches,libcdr, \
external/libcdr/ubsan-visibility.patch \
))
endif
endif
# vim: set noet sw=4 ts=4: