mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +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
|
@ -29,7 +29,7 @@ WORKDIR /srs/trunk
|
||||||
# Build and install SRS.
|
# Build and install SRS.
|
||||||
# Note that SRT is enabled by default, so we configure without --srt=on.
|
# Note that SRT is enabled by default, so we configure without --srt=on.
|
||||||
# Note that we have copied all files by make install.
|
# Note that we have copied all files by make install.
|
||||||
RUN ./configure --gb28181=on --sanitizer-static=on ${CONFARGS} && make ${MAKEARGS} && make install
|
RUN ./configure --gb28181=on ${CONFARGS} && make ${MAKEARGS} && make install
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# dist
|
# dist
|
||||||
|
|
|
@ -117,7 +117,18 @@ if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then
|
||||||
fi
|
fi
|
||||||
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 "#include <sanitizer/asan_interface.h>" > ${SRS_OBJS}/test_sanitizer.c &&
|
||||||
echo "int main() { return 0; }" >> ${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 \
|
gcc -fsanitize=address -fno-omit-frame-pointer -g -O0 ${SRS_OBJS}/test_sanitizer.c \
|
||||||
|
|
|
@ -68,7 +68,7 @@ SRS_LOG_LEVEL_V2=YES
|
||||||
# Experts options.
|
# Experts options.
|
||||||
SRS_USE_SYS_SSL=NO # Use system ssl(-lssl) if required.
|
SRS_USE_SYS_SSL=NO # Use system ssl(-lssl) if required.
|
||||||
SRS_VALGRIND=NO
|
SRS_VALGRIND=NO
|
||||||
SRS_SANITIZER=YES
|
SRS_SANITIZER=NO
|
||||||
SRS_SANITIZER_STATIC=NO
|
SRS_SANITIZER_STATIC=NO
|
||||||
SRS_SANITIZER_LOG=NO
|
SRS_SANITIZER_LOG=NO
|
||||||
SRS_BUILD_TAG= # Set the object files tag name.
|
SRS_BUILD_TAG= # Set the object files tag name.
|
||||||
|
@ -503,6 +503,13 @@ function apply_auto_options() {
|
||||||
SRS_FFMPEG_FIT=YES
|
SRS_FFMPEG_FIT=YES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable asan, but disable for Centos
|
||||||
|
# @see https://github.com/ossrs/srs/issues/3347
|
||||||
|
if [[ $SRS_SANITIZER == NO && $OS_IS_CENTOS != YES ]]; then
|
||||||
|
echo "Enable asan by auto options."
|
||||||
|
SRS_SANITIZER=YES
|
||||||
|
fi
|
||||||
|
|
||||||
# If enable gperf, disable sanitizer.
|
# If enable gperf, disable sanitizer.
|
||||||
if [[ $SRS_GPERF == YES && $SRS_SANITIZER == YES ]]; then
|
if [[ $SRS_GPERF == YES && $SRS_SANITIZER == YES ]]; then
|
||||||
echo "Disable sanitizer for gperf"
|
echo "Disable sanitizer for gperf"
|
||||||
|
|
5
trunk/configure
vendored
5
trunk/configure
vendored
|
@ -197,11 +197,6 @@ if [[ $SRS_STATIC == YES ]]; then
|
||||||
SrsLinkOptions="${SrsLinkOptions} -static-libstdc++";
|
SrsLinkOptions="${SrsLinkOptions} -static-libstdc++";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For asan(Google Address Sanitizer)
|
|
||||||
if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_STATIC == YES ]]; then
|
|
||||||
SrsLinkOptions="${SrsLinkOptions} -static-libasan";
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For coverage.
|
# For coverage.
|
||||||
if [[ $SRS_GCOV == YES ]]; then
|
if [[ $SRS_GCOV == YES ]]; then
|
||||||
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
|
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
|
||||||
|
|
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 5.0 Changelog
|
## SRS 5.0 Changelog
|
||||||
|
|
||||||
|
* v5.0, 2023-01-02, Fix [#3347](https://github.com/ossrs/srs/issues/3347): Asan: Disable asan for CentOS and use statically link if possible. v5.0.127
|
||||||
* v5.0, 2023-01-01, For [#296](https://github.com/ossrs/srs/issues/296): MP3: Upgrade mpegts.js to support HTTP-TS with mp3. v5.0.126
|
* v5.0, 2023-01-01, For [#296](https://github.com/ossrs/srs/issues/296): MP3: Upgrade mpegts.js to support HTTP-TS with mp3. v5.0.126
|
||||||
* v5.0, 2023-01-01, For [#3349](https://github.com/ossrs/srs/issues/3349): API: Fix duplicated on_stop callback event bug. v5.0.125
|
* v5.0, 2023-01-01, For [#3349](https://github.com/ossrs/srs/issues/3349): API: Fix duplicated on_stop callback event bug. v5.0.125
|
||||||
* v5.0, 2022-12-31, GB28181: Enable regression test for gb28181. v5.0.122
|
* v5.0, 2022-12-31, GB28181: Enable regression test for gb28181. v5.0.122
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 5
|
#define VERSION_MAJOR 5
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 126
|
#define VERSION_REVISION 127
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue