Skip to content

qemu-vexpress-a9同时开启rt-smart和smp无法通过编译 #7684

Open

Description

@messigogogo

在v5.0.1版本中,menuconfig中同时开启rt-smart和smp后,编译时出现'mmu_info' undeclared (first use in this function)报错。
bdb04ae211ee44165fc3a20f69e5832
325395a805f946e9b8309f9e2ae5d79

Activity

  1. sexenteen commented on Nov 1, 2026

    @sexenteen

    在 5.3.1 上按"同时开 rt-smart 和 SMP"复现了一遍,结论是:这不是缺陷,而是缺少 musl 工具链;而且 v5.0.1 那个 mmu_info 报错现在也不复现了。

    1. 现在的报错(比原来清楚)

    在 bsp/qemu-vexpress-a9 上打开 RT_USING_SMART + RT_USING_SMP(RT_CPUS_NR=2)后编译:

    CC build/drivers/board.o
    In file included from components/lwp/arch/arm/cortex-a/lwp_arch.h:13,
                     from drivers/board.c:24:
    components/lwp/lwp.h:99:2: error: #error "No compatible lwp set status provided for this libc"
    

    对应 components/lwp/lwp.h:92-100:

    #ifdef RT_USING_MUSLLIBC
    #define LWP_CREATE_STAT_EXIT(exit_code)  ...
    #define LWP_CREATE_STAT_SIGNALED(signo, coredump) ...
    ...
    #else
    #error "No compatible lwp set status provided for this libc"
    #endif

    即:rt-smart(LWP)要求 RT_USING_MUSLLIBC。

    2. 为什么这个 BSP 默认编不过

    bsp/qemu-vexpress-a9/rtconfig.py:39:

    PREFIX = os.getenv('RTT_CC_PREFIX') or 'arm-none-eabi-'

    默认工具链是 arm-none-eabi(裸机 newlib)(构建日志里也会打印 Newlib version: 4.1.0),
    而 RT_USING_MUSLLIBC 由 musl 工具链(arm-linux-musleabi-)提供 —— 主仓里没有任何 Kconfig 定义它。

    3. 结论与建议

    • 不是 bug:这是"配置组合与工具链不匹配",编译期就被 #error 明确拦下了(比 v5.0.1 的
      mmu_info 未声明要友好得多,那个问题已随代码重构消失)。
    • 想在 vexpress-a9 上真正跑 rt-smart,需要换 musl 工具链
      (RTT_CC_PREFIX=arm-linux-musleabi-)并采用 rt-smart 的内核/用户态构建方式,不是只改 menuconfig 两项就够。
    • 想改善体验的话,建议把这条限制写进文档,或者在 Kconfig 里给 RT_USING_SMART 加上"依赖 musl libc"的约束,
      让 menuconfig 阶段就能提示,而不是等到编译。
    • 如果你认可,这个 issue 可以关闭了。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions