mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
* Asan: Disable asan for CentOS and use statically link if possible. v5.0.127 (#3347) 1. Disable asan for all CentOS by default, however user could enable it. 2. Link asan statically if possible. * Update version to v5.0.127 Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
02a18b328c
commit
dd0f398296
6 changed files with 23 additions and 9 deletions
|
@ -117,7 +117,18 @@ if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then
|
||||
if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_STATIC == NO ]]; then
|
||||
echo 'int main() { return 0; }' > ${SRS_OBJS}/test_sanitizer.c &&
|
||||
gcc -fsanitize=address -fno-omit-frame-pointer -static-libasan -g -O0 ${SRS_OBJS}/test_sanitizer.c \
|
||||
-o ${SRS_OBJS}/test_sanitizer 1>/dev/null 2>&1;
|
||||
ret=$?; rm -rf ${SRS_OBJS}/test_sanitizer*
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "link static-libasan"
|
||||
SRS_SANITIZER_STATIC=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_LOG == NO ]]; then
|
||||
echo "#include <sanitizer/asan_interface.h>" > ${SRS_OBJS}/test_sanitizer.c &&
|
||||
echo "int main() { return 0; }" >> ${SRS_OBJS}/test_sanitizer.c &&
|
||||
gcc -fsanitize=address -fno-omit-frame-pointer -g -O0 ${SRS_OBJS}/test_sanitizer.c \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue