提交 7ddd0001 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Adding clang-fuzzer stuff (work in progress)

上级 8fec9c9f
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
/worker/out/ /worker/out/
/worker/**/*.xcodeproj/ /worker/**/*.xcodeproj/
# clang+fuzzer stuff is too big.
/worker/deps/clang-fuzzer
# Vim temporal files. # Vim temporal files.
*.swp *.swp
*.swo *.swo
...@@ -41,6 +41,17 @@ test-Debug: ...@@ -41,6 +41,17 @@ test-Debug:
xcode: xcode:
cd worker && $(PYTHON) ./scripts/configure.py --format=xcode cd worker && $(PYTHON) ./scripts/configure.py --format=xcode
build-fuzzer:
ifeq ($(DOCKER_NO_CACHE),true)
cd worker && docker build -f fuzzer/Dockerfile --no-cache --tag mediasoup/fuzzer:latest .
else
cd worker && docker build -f fuzzer/Dockerfile --tag mediasoup/fuzzer:latest .
endif
# TODO: Remove the volume. Not needed.
run-fuzzer:
cd worker/fuzzer && docker run --name=mediasoupFuzzer -v $(shell pwd)/worker/fuzzer/deleteme:/volume -it --rm mediasoup/fuzzer:latest
clean: clean:
$(RM) -rf worker/out/Release/mediasoup-worker $(RM) -rf worker/out/Release/mediasoup-worker
$(RM) -rf worker/out/Release/obj.target/mediasoup-worker $(RM) -rf worker/out/Release/obj.target/mediasoup-worker
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
'-Wno-parentheses-equality', '-Wno-parentheses-equality',
], ],
}, },
'conditions': 'conditions':
[ [
[ 'target_arch == "ia32"', { [ 'target_arch == "ia32"', {
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
'target_conditions': 'target_conditions':
[ [
[ '_type == "static_library"', { [ '_type == "static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19 'standalone_static_library': 1, # Disable thin archive which needs binutils >= 2.19
}] }]
], ],
'conditions': 'conditions':
......
...@@ -121,10 +121,31 @@ function get_lcov() ...@@ -121,10 +121,31 @@ function get_lcov()
get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}" get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}"
} }
function get_clang_fuzzer()
{
NAME="clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04"
TAR_FILE="${NAME}.tar.xz"
TAR_URL="http://releases.llvm.org/7.0.0/${TAR_FILE}"
DEST="deps/clang-fuzzer"
set -x
rm -rf ${DEST}
mkdir ${DEST}
cd ${DEST}
mkdir bin lib
wget ${TAR_URL}
tar xfJ ${TAR_FILE}
rm -f ${TAR_FILE}
mv ${NAME}/bin/* bin/
mv ${NAME}/lib/clang lib/
rm -rf ${NAME}
}
case "${DEP}" in case "${DEP}" in
'-h') '-h')
echo "Usage:" echo "Usage:"
echo " ./scripts/$(basename $0) [gyp|jsoncpp|netstring|libuv|openssl|libsrtp|catch|lcov]" echo " ./scripts/$(basename $0) [gyp|jsoncpp|netstring|libuv|openssl|libsrtp|catch|lcov|clang-fuzzer]"
echo echo
;; ;;
gyp) gyp)
...@@ -151,6 +172,9 @@ case "${DEP}" in ...@@ -151,6 +172,9 @@ case "${DEP}" in
lcov) lcov)
get_lcov get_lcov
;; ;;
clang-fuzzer)
get_clang_fuzzer
;;
*) *)
echo ">>> [ERROR] unknown dep '${DEP}'" >&2 echo ">>> [ERROR] unknown dep '${DEP}'" >&2
exit 1 exit 1
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论