winlin

fix #485, error when arm glibc 2.15+ or not i386/x86_64/amd64. 2.0.192

... ... @@ -335,6 +335,7 @@ Remark:
## History
* v2.0, 2015-09-23, for [#485][bug #485] error when arm glibc 2.15+ or not i386/x86_64/amd64. 2.0.192
* v2.0, 2015-09-23, for [#485][bug #485] srs for respberrypi and cubieboard. 2.0.191
* v2.0, 2015-09-21, fix [#484][bug #484] hotfix the openssl build script 2.0.190
* <strong>v2.0, 2015-09-14, [2.0 alpha1(2.0.189)][r2.0a1] released. 89269 lines.</strong>
... ...
... ... @@ -38,7 +38,11 @@ function Ubuntu_prepare()
else
uname -v|grep Ubuntu >/dev/null 2>&1
ret=$?; if [[ 0 -ne $ret ]]; then
return 0;
# for debian, we think it's ubuntu also.
# for example, the wheezy/sid which is debian armv7 linux, can not identified by uname -v.
if [[ ! -f /etc/debian_version ]]; then
return 0;
fi
fi
fi
... ... @@ -378,7 +382,7 @@ fi
#####################################################################################
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
# check the cross build flag file, if flag changed, need to rebuild the st.
_ST_MAKE=linux-debug && _ST_EXTRA_CFLAGS="EXTRA_CFLAGS=-DMD_HAVE_EPOLL"
_ST_MAKE=linux-debug && _ST_EXTRA_CFLAGS="-DMD_HAVE_EPOLL"
# for osx, use darwin for st, donot use epoll.
if [ $OS_IS_OSX = YES ]; then
_ST_MAKE=darwin-debug && _ST_EXTRA_CFLAGS="EXTRA_CFLAGS=-DMD_HAVE_KQUEUE"
... ... @@ -399,7 +403,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&
patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch &&
patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch &&
make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} ${_ST_EXTRA_CFLAGS} &&
make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" &&
cd .. && rm -rf st && ln -sf st-1.9/obj st &&
cd .. && touch ${SRS_OBJS}/_flag.st.cross.build.tmp
)
... ... @@ -416,7 +420,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&
patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch &&
patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch &&
make ${_ST_MAKE} ${_ST_EXTRA_CFLAGS} &&
make ${_ST_MAKE} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" &&
cd .. && rm -rf st && ln -sf st-1.9/obj st &&
cd .. && rm -f ${SRS_OBJS}/_flag.st.cross.build.tmp
)
... ...
... ... @@ -99,6 +99,7 @@
3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9B1AB6AAC800C9CEEE /* sched.c */; };
3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9C1AB6AAC800C9CEEE /* stk.c */; };
3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9D1AB6AAC800C9CEEE /* sync.c */; };
3CB25C2A1BB269FD00C97A63 /* jmp_sp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CB25C291BB269FD00C97A63 /* jmp_sp.cpp */; };
3CC52DD81ACE4023006FEB01 /* srs_utest_amf0.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */; };
3CC52DD91ACE4023006FEB01 /* srs_utest_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */; };
3CC52DDA1ACE4023006FEB01 /* srs_utest_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCE1ACE4023006FEB01 /* srs_utest_core.cpp */; };
... ... @@ -353,6 +354,7 @@
3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; };
3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; };
3CB25C281BB2596300C97A63 /* setup_variables.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setup_variables.sh; path = ../../../auto/setup_variables.sh; sourceTree = "<group>"; };
3CB25C291BB269FD00C97A63 /* jmp_sp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jmp_sp.cpp; path = ../../../research/arm/jmp_sp.cpp; sourceTree = "<group>"; };
3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_amf0.cpp; path = ../../src/utest/srs_utest_amf0.cpp; sourceTree = "<group>"; };
3CC52DCB1ACE4023006FEB01 /* srs_utest_amf0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_utest_amf0.hpp; path = ../../src/utest/srs_utest_amf0.hpp; sourceTree = "<group>"; };
3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_config.cpp; path = ../../src/utest/srs_utest_config.cpp; sourceTree = "<group>"; };
... ... @@ -738,6 +740,7 @@
3C663F001AB014B500286D8B /* research */ = {
isa = PBXGroup;
children = (
3CB25C291BB269FD00C97A63 /* jmp_sp.cpp */,
3C663F021AB0155100286D8B /* srs_aac_raw_publish.c */,
3C663F031AB0155100286D8B /* srs_audio_raw_publish.c */,
3C663F041AB0155100286D8B /* srs_bandwidth_check.c */,
... ... @@ -925,6 +928,7 @@
3C28EDDF1AF5C43F00A3AEAC /* srs_app_caster_flv.cpp in Sources */,
3C1232241AAE814D00CE8F6C /* srs_kernel_error.cpp in Sources */,
3C036B561B2D0AC10078E2E0 /* srs_app_http_stream.cpp in Sources */,
3CB25C2A1BB269FD00C97A63 /* jmp_sp.cpp in Sources */,
3C068D6D1B10175500AA722C /* srs_protocol_buffer.cpp in Sources */,
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
3C1232291AAE814D00CE8F6C /* srs_kernel_stream.cpp in Sources */,
... ...
... ... @@ -11,22 +11,7 @@
jmp_buf context;
void func1()
{
#if defined(__amd64__) || defined(__x86_64__)
register long int rsp0 asm("rsp");
int ret = setjmp(context);
printf("setjmp func1 ret=%d, rsp=%#lx\n", ret, rsp0);
// enter by longjmp
if (ret != 0) {
printf("call by longjmp.\n");
exit(0);
}
#endif
}
void func0()
void do_longjmp()
{
/**
the definition of jmp_buf:
... ... @@ -78,8 +63,6 @@ void func0()
printf("env[%d]=%#x, ", i, (int)context[0].__jmpbuf[i]);
}
printf("\n");
func1();
#endif
#if defined(__arm__)
... ... @@ -105,7 +88,7 @@ void func0()
*/
/**
For example, on raspberry-pi, armv6 cpu:
(gdb) x /64 context[0].__jmpbuf
(gdb) x /64xb (char*)context[0].__jmpbuf
v1, 0: 0x00 0x00 0x00 0x00
v2, 1: 0x00 0x00 0x00 0x00
v3, 2: 0x2c 0x84 0x00 0x00
... ... @@ -147,8 +130,7 @@ int main(int argc, char** argv)
(int)__GLIBC__, (int)__GLIBC_MINOR__);
#endif
func0();
longjmp(context, 1);
do_longjmp();
printf("terminated\n");
... ...
... ... @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 191
#define VERSION_REVISION 192
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
... ... @@ -119,5 +119,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
className(const className&); \
className& operator= (const className&)
/**
* important check for st(state-threads),
* only support the following cpus:
* 1. i386/amd64/x86_64
* 2. arm, glibc <= 2.15
*/
#if !defined(__amd64__) && !defined(__x86_64__) && !defined(__i386__) && !defined(__arm__)
#error "only support i386/amd64/x86_64/arm cpu"
#endif
#if defined(__arm__) && __GLIBC__ != 2 || __GLIBC_MINOR__ > 15
#error "for arm, only support glibc <= 2.15"
#endif
#endif
... ...