Skip to content

aosp中编译srs-server及libst报错 #26

@sunplusApp

Description

@sunplusApp

目前我在做的是将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的问题吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions