mirror of https://github.com/google/oss-fuzz.git
[infra] build msan version of libcxx into /usr/msan/lib (#59).
This commit is contained in:
parent
f22ee6eb3a
commit
2de24fc520
|
@ -25,7 +25,7 @@ cd $SRC/llvm/projects && git clone --depth 1 http://llvm.org/git/compiler-rt.git
|
|||
cd $SRC/llvm/projects && git clone --depth 1 http://llvm.org/git/libcxx.git
|
||||
cd $SRC/llvm/projects && git clone --depth 1 http://llvm.org/git/libcxxabi.git
|
||||
|
||||
# Build & Install
|
||||
# Build & install
|
||||
mkdir -p $WORK/llvm
|
||||
cd $WORK/llvm
|
||||
cmake -G "Ninja" \
|
||||
|
@ -36,6 +36,18 @@ ninja
|
|||
ninja install
|
||||
rm -rf $WORK/llvm
|
||||
|
||||
mkdir -p $WORK/msan
|
||||
cd $WORK/msan
|
||||
cmake -G "Ninja" \
|
||||
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
||||
-DLLVM_USE_SANITIZER=Memory -DCMAKE_INSTALL_PREFIX=/usr/msan/ \
|
||||
-DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \
|
||||
$SRC/llvm
|
||||
ninja cxx
|
||||
ninja install-cxx
|
||||
rm -rf $WORK/msan
|
||||
|
||||
# Copy libfuzzer sources
|
||||
mkdir $SRC/libfuzzer
|
||||
cp -r $SRC/llvm/lib/Fuzzer/* $SRC/libfuzzer/
|
||||
|
|
|
@ -24,9 +24,17 @@ fi
|
|||
|
||||
bash compile_${FUZZING_ENGINE}
|
||||
|
||||
if [[ $SANITIZER_FLAGS = *sanitize=memory* ]]
|
||||
then
|
||||
# Take all libraries from lib/msan
|
||||
export CXXFLAGS_EXTRA="-L/usr/msan/lib $CXXFLAGS_EXTRA"
|
||||
ls -alR /usr/msan/lib
|
||||
fi
|
||||
|
||||
export CFLAGS="$CFLAGS $SANITIZER_FLAGS $COVERAGE_FLAGS"
|
||||
export CXXFLAGS="$CFLAGS $CXXFLAGS_EXTRA"
|
||||
|
||||
|
||||
echo "CC=$CC"
|
||||
echo "CXX=$CXX"
|
||||
echo "CFLAGS=$CFLAGS"
|
||||
|
|
Loading…
Reference in New Issue