ofz: better workaround for broken msan build

workaround https://github.com/google/oss-fuzz/issues/6427 by
forcing use of the libc++.a in /usr/msan/lib when compiling the
msan version

Change-Id: I4e992cd7710b5929e74034db7a49c590349149fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122014
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2021-09-12 22:27:02 +02:00
parent 34d229ceca
commit 78a2c0752c
3 changed files with 3 additions and 17 deletions
+3
View File
@@ -12,6 +12,9 @@ echo start at `date -u`
#shuffle CXXFLAGS -stdlib=libc++ arg into CXX as well because we use
#the CXX as the linker and need to pass -stdlib=libc++ to build
export CXX="$CXX -stdlib=libc++ -fsanitize-blacklist=$SRC/libreoffice/bin/sanitize-excludelist.txt"
if [[ $SANITIZER_FLAGS = *sanitize=memory* ]]; then
export CXX="$CXX -Wno-unused-command-line-argument -L/usr/msan/lib"
fi
export CC="$CC -fsanitize-blacklist=$SRC/libreoffice/bin/sanitize-excludelist.txt"
#similarly force the -fsanitize etc args in as well as pthread to get
#things to link successfully during the build
-2
View File
@@ -61,7 +61,6 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
m_aDocument.GetStyleSheetPool()->CreateStandardStyles();
m_aDocument.UpdStlShtPtrsFrmNms();
#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
if (!m_bUcalcTest)
{
/* Create styles that are imported through Orcus */
@@ -79,7 +78,6 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
m_aDocument.GetStyleSheetPool()->setAllParaStandard();
}
}
#endif
// SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems();
-15
View File
@@ -125,11 +125,6 @@ namespace Translate
auto aFind = aCache.find(sUnique);
if (aFind != aCache.end())
return aFind->second;
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
std::locale aRet;
aCache[sUnique] = aRet;
return aRet;
#else
boost::locale::generator gen;
gen.characters(boost::locale::char_facet);
gen.categories(boost::locale::message_facet | boost::locale::information_facet);
@@ -201,14 +196,10 @@ namespace Translate
aCache[sUnique] = aRet;
return aRet;
#endif
}
OUString get(TranslateId sContextAndId, const std::locale &loc)
{
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
return createFromUtf8(sContextAndId.mpId, strlen(sContextAndId.mpId));
#else
assert(!strchr(sContextAndId.mpId, '\004') && "should be using nget, not get");
//if it's a key id locale, generate it here
@@ -230,15 +221,10 @@ namespace Translate
result = result.replaceAll(OUString::fromUtf8("\xC3\x9F"), "ss");
}
return result;
#endif
}
OUString nget(TranslateNId aContextSingularPlural, int n, const std::locale &loc)
{
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
const char* pForm = n == 0 ? aContextSingularPlural.mpSingular : aContextSingularPlural.mpPlural;
return createFromUtf8(pForm, strlen(pForm));
#else
//if it's a key id locale, generate it here
if (std::use_facet<boost::locale::info>(loc).language() == "qtz")
{
@@ -258,7 +244,6 @@ namespace Translate
result = result.replaceAll(OUString::fromUtf8("\xC3\x9F"), "ss");
}
return result;
#endif
}
static ResHookProc pImplResHookProc = nullptr;