diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 60847c57f..65fab1112 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -743,7 +743,7 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then # For MIPS, which fail with: # ./libavutil/libm.h:54:32: error: static declaration of 'cbrt' follows non-static declaration # /root/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/math.h:163:13: note: previous declaration of 'cbrt' was here - if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" ]]; then + if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" || $SRS_CROSS_BUILD_ARCH == "arm" ]]; then sed -i -e 's/#define HAVE_CBRT 0/#define HAVE_CBRT 1/g' config.h && sed -i -e 's/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/g' config.h && sed -i -e 's/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/g' config.h && @@ -812,12 +812,18 @@ if [[ $SRS_SRT == YES ]]; then exit -1; fi # Always disable c++11 for libsrt, because only the srt-app requres it. - LIBSRT_OPTIONS="--disable-apps --enable-static --enable-c++11=0" + LIBSRT_OPTIONS="--enable-apps=0 --enable-static=1 --enable-c++11=0" if [[ $SRS_SHARED_SRT == YES ]]; then LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=1" else LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=0" fi + # For cross-build. + if [[ $SRS_CROSS_BUILD == YES ]]; then + TOOL_GCC_REALPATH=$(realpath $(which $SRS_TOOL_CC)) + SRT_COMPILER_PREFIX=$(echo $TOOL_GCC_REALPATH |sed 's/-gcc.*$/-/') + LIBSRT_OPTIONS="$LIBSRT_OPTIONS --with-compiler-prefix=$SRT_COMPILER_PREFIX" + fi # Start build libsrt. rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit && cd ${SRS_OBJS}/${SRS_PLATFORM} && cp -R ../../3rdparty/srt-1-fit srt-1-fit && cd srt-1-fit && diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index bbc35e10a..032a440fb 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -410,11 +410,6 @@ function apply_auto_options() { SRS_X86_X64=YES; opt="--x86-x64 $opt"; fi - # Covert prefix without directory. - if [[ $SRS_CROSS_BUILD_PREFIX != "" ]]; then - SRS_CROSS_BUILD_PREFIX=$(basename $SRS_CROSS_BUILD_PREFIX) - fi - if [[ $SRS_CROSS_BUILD == YES ]]; then if [[ $SRS_CROSS_BUILD_PREFIX != "" && $SRS_CROSS_BUILD_HOST == "" ]]; then SRS_CROSS_BUILD_HOST=$(echo $SRS_CROSS_BUILD_PREFIX| sed 's/-$//g') diff --git a/trunk/auto/setup_variables.sh b/trunk/auto/setup_variables.sh index cf9b1a98b..e141148e5 100755 --- a/trunk/auto/setup_variables.sh +++ b/trunk/auto/setup_variables.sh @@ -20,7 +20,8 @@ fi SRS_PLATFORM="${SRS_PLATFORM}-SRS5-$(uname -m)" if [[ $SRS_CROSS_BUILD == YES ]]; then - SRS_PLATFORM="${SRS_PLATFORM}-CROSSBUILD-$(echo $SRS_TOOL_CC|awk -F - '{print $1}')" + SRS_TOOL_CC_NAME=$(basename $SRS_TOOL_CC) + SRS_PLATFORM="${SRS_PLATFORM}-crossbuild-$(echo $SRS_TOOL_CC_NAME|awk -F - '{print $1"-"$2}')" fi echo "SRS_WORKDIR: ${SRS_WORKDIR}, SRS_OBJS_DIR: ${SRS_OBJS_DIR}, SRS_OBJS: ${SRS_OBJS}, SRS_PLATFORM: ${SRS_PLATFORM}" diff --git a/trunk/conf/origin.hls.only1.conf b/trunk/conf/origin.hls.only1.conf index 9be5e7b15..088d146a2 100644 --- a/trunk/conf/origin.hls.only1.conf +++ b/trunk/conf/origin.hls.only1.conf @@ -1,4 +1,4 @@ -# the config for srs origin-edge cluster +# the config for isolated origin server to reuse port. # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port # @see full.conf for detail config. diff --git a/trunk/conf/origin.hls.only2.conf b/trunk/conf/origin.hls.only2.conf index b1a78d2ed..7989d488d 100644 --- a/trunk/conf/origin.hls.only2.conf +++ b/trunk/conf/origin.hls.only2.conf @@ -1,4 +1,4 @@ -# the config for srs origin-edge cluster +# the config for isolated origin server to reuse port. # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port # @see full.conf for detail config. diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 51ad0b6f2..87a689f39 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -6,6 +6,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2022-08-12, Support crossbuild for hisiv500. v5.0.40 * v5.0, 2022-08-10, Build: Detect OS by packager. v5.0.39 * v5.0, 2022-08-06, Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.38 * v5.0, 2022-06-29, Support multiple threads by thread pool. v5.0.32 diff --git a/trunk/src/app/srs_app_threads.cpp b/trunk/src/app/srs_app_threads.cpp index 7dfc5d24c..fb38684e7 100644 --- a/trunk/src/app/srs_app_threads.cpp +++ b/trunk/src/app/srs_app_threads.cpp @@ -44,6 +44,13 @@ using namespace std; #endif #endif +// These functions first appeared in glibc in version 2.12. +// See https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html +#if defined(SRS_CROSSBUILD) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)) + void pthread_setname_np(pthread_t trd, const char* name) { + } +#endif + extern ISrsLog* _srs_log; extern ISrsContext* _srs_context; extern SrsConfig* _srs_config; diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index a7f058dae..bfef473a3 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 39 +#define VERSION_REVISION 40 #endif