Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support buildin setjmp/longjmp for ARM #1

Closed
winlinvip opened this issue Sep 3, 2016 · 12 comments
Closed

Support buildin setjmp/longjmp for ARM #1

winlinvip opened this issue Sep 3, 2016 · 12 comments
Labels

Comments

@winlinvip
Copy link
Member

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.

@winlinvip
Copy link
Member Author

winlinvip commented Sep 3, 2016

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

@winlinvip
Copy link
Member Author

winlinvip commented Sep 3, 2016

@winlinvip
Copy link
Member Author

winlinvip commented Sep 3, 2016

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.

winlinvip referenced this issue in michaeltalyansky/state-threads Sep 3, 2016
@winlinvip
Copy link
Member Author

winlinvip commented Sep 3, 2016

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

@winlinvip winlinvip reopened this Sep 3, 2016
winlinvip referenced this issue Sep 3, 2016
* add ARMv7 support

* add ARM buildin setjmp/longjmp support
@winlinvip
Copy link
Member Author

PI2 is ok.

winlinvip added a commit to ossrs/srs-bench that referenced this issue Sep 3, 2016
@winlinvip
Copy link
Member Author

winlinvip commented Sep 5, 2016

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__'

@yjlsmx
Copy link

yjlsmx commented Mar 2, 2017

为什么不支持mips呢?

@winlinvip
Copy link
Member Author

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

@yjlsmx
Copy link

yjlsmx commented Mar 2, 2017

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

@winlinvip
Copy link
Member Author

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

@winlinvip
Copy link
Member Author

winlinvip commented Jul 11, 2017

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.

@winlinvip
Copy link
Member Author

为什么不支持mips呢?

正在支持,哈哈哈,#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants