ossrs / state-threads

Lightweight thread library for C/C++ coroutine (similar to goroutine), for high performance network servers.

Home Page:http://sourceforge.net/projects/state-threads

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support buildin setjmp/longjmp for ARM

winlinvip opened this issue · comments

The ARM use glibc setjmp/longjmp, which is not available for high version ARM, for example, RespberryPi2. We must use the buildin setjmp/longjmp like the ia64/x86-64/amd64/i386, use asm to implements setjmp/longjmp.

RaspberryPi2,__GLIBC__=2, __GLIBC_MINOR__=19,the setjmp/longjmp use guarded jmpbuf, we cannot directly set the SP.

SRS2.0 don't check the glibc version in ossrs/srs@e775eb3, but user must use the patched ST, should not use the ST of SRS in ARM.

To build ST of SRS, read usage of ST.

xzh3836598 send a PR to support buildin setjmp/longjmp for ARM, it's another solution. #3

PI2 is ok.

To use glibc to hack the guard jmpbuf from michaeltalyansky, please define the macro USE_LIBC_SETJMP, or make linux-debug EXTRA_CFLAGS="-DUSE_LIBC_SETJMP"

To use asm setjmp/longjmp from xzh3836598, please define the macro MD_USE_BUILTIN_SETJMP, or make linux-debug EXTRA_CFLAGS="-DMD_USE_BUILTIN_SETJMP"(default this solution).

For SRS3,you can pass the macro by configure:./configure --extra-flags='-DUSE_LIBC_SETJMP'

For some server which may do not define the macro __arm__, you can use configure to define it: ./configure --extra-flags='-D__arm__'

commented

为什么不支持mips呢?

MIPS貌似是可以支持的,ST本身那个就没有问题。
我对于寄存器不了解,这些PATCH都是别的大神做的。

commented

谢谢你的回复,我在wrtnode(国内 openwrt+mt7620 开源硬件)尝试过, srs-csdn/trunk/src/core/srs_core.hpp 里有个: #error "only support i386/amd64/x86_64/arm cpu",编译失败,提示并不支持mips,为什么会有这个编译错误提示呢?

不确定其他的是不是支持,就检查了。你可以自己去掉。

User can use SRS3, or patch ST of SRS1/2 by:

  1. Please remove the objs/st-1.9 and use this repository to replace it.
  2. Enter cd objs/st-1.9 and build ST: https://github.com/ossrs/state-threads/tree/srs#usage
  3. Build SRS and launch it.

为什么不支持mips呢?

正在支持,哈哈哈,#21