diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-11 10:47:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-11 10:56:06 +0100 |
commit | 62b124b2704adf11a63681164d05a8eb49dfb105 (patch) | |
tree | 40935fce17bde513db24d2789217b41378bd20f0 /compilerplugins/clang | |
parent | b162753eadd963fdbad691e30005182e2d9d538a (diff) |
Ensure RTTI symbol visibility for Linux Clang -fsanitize=function,vptr
The problem being that any lib later loaded via osl_loadModule (e.g.,
libgcc3_uno.so) would not bind to the same global (RTTI-related) symbols as
libsofficeapp.so and its dependencies (so, e.g., -fsanitize=function would
erroneously assume that bridges/source/cpp_uno/shared/component.cxx's
uno_initEnvironment is called with a different, non-matching uno_Environment
type).
Change-Id: I08b0cbc1f9eb74641eb617c46587a0a528a56c31
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/checkconfigmacros.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compilerplugins/clang/checkconfigmacros.cxx b/compilerplugins/clang/checkconfigmacros.cxx index 74a45db151ed..6dea3cebc81b 100644 --- a/compilerplugins/clang/checkconfigmacros.cxx +++ b/compilerplugins/clang/checkconfigmacros.cxx @@ -129,9 +129,14 @@ void CheckConfigMacros::checkMacro( const Token& macroToken, SourceLocation loca { if( configMacros.find( macroToken.getIdentifierInfo()->getName()) != configMacros.end()) { - report( DiagnosticsEngine::Error, "checking whether a config macro %0 is defined", - location ) << macroToken.getIdentifierInfo()->getName(); - report( DiagnosticsEngine::Note, "use #if instead of #ifdef/#ifndef/defined", location ); + const char* filename = compiler.getSourceManager().getPresumedLoc( location ).getFilename(); + if( filename == NULL + || strncmp( filename, SRCDIR "/include/LibreOfficeKit/", strlen( SRCDIR "/include/LibreOfficeKit/" )) != 0 ) + { + report( DiagnosticsEngine::Error, "checking whether a config macro %0 is defined", + location ) << macroToken.getIdentifierInfo()->getName(); + report( DiagnosticsEngine::Note, "use #if instead of #ifdef/#ifndef/defined", location ); + } } } |