ossrs / ossrs/state-threads

aosp中编译srs-server及libst报错

Open
#26 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
759
Forks
277
PR merge metrics
No merged PRs in 30d

Description

目前我在做的是将srs及libst源码放入android源码中交叉编译,然后集成进安卓手机中(手机CPU架构aarch64)。
android源码现在是用clang 编译。
在编译libst时,这个MD_GET_SP宏报错

#elif defined(__aarch64__)
            /* https://github.com/ossrs/state-threads/issues/9 */
            #define MD_STACK_GROWS_DOWN
            #define MD_USE_BUILTIN_SETJMP
            #define MD_GET_SP(_t) ((_t)->context[0].__jmpbuf[13])

报错内容:

system/core/libst/sched.c:616:9: error: member reference base type 'long' is not a structure or union
        _ST_INIT_CONTEXT(thread, stack->sp, _st_thread_main);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
system/core/libst/common.h:442:30: note: expanded from macro '_ST_INIT_CONTEXT'
    #define _ST_INIT_CONTEXT MD_INIT_CONTEXT
                             ^
system/core/libst/md.h:472:13: note: expanded from macro 'MD_INIT_CONTEXT'
            MD_GET_SP(_thread) = (long) (_sp);         \
            ^~~~~~~~~~~~~~~~~~
system/core/libst/md.h:429:52: note: expanded from macro 'MD_GET_SP'
            #define MD_GET_SP(_t) ((_t)->context[0].__jmpbuf[13])
                                   ~~~~~~~~~~~~~~~~^~~~~~~~~

请问这个是什么原因啊?是clang的问题吗?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with system/core/libst/md.h and inspect MD_GET_SP and the AArch64 context definition used by Android's clang. Trace the expansion from system/core/libst/sched.c through common.h and md.h, then compare the expected type of context[0].__jmpbuf[13]. Done means identifying the cause and documenting a compatible resolution for the AArch64 Android build.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.