RT-Thread / RT-Thread/rt-thread
[Bug] 很多bsp对c++的自动构造函数支持有问题
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
master
Affected area
Board Support Package (BSP)
Hardware/BSP vendor
HPMicro
Architecture
RISC-V
Board and hardware details
hpm
Develop Toolchain
GCC
Describe the bug
cplusplus_system_init 目前只调用[ctors_start, ctors_end),而 GCC(可能是新版特性) 把 ctor 放在 .init_array了。
我拿ci检测了一下:https://github.com/kaidegit/rt-thread/actions/runs/33521591507
解决方案是规范一下链接脚本(把init array也放到[ctors_start, ctors_end)),还是cplusplus_system_init也跑一下init array部分呢?
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cplusplus_system_init and the HPMicro BSP linker scripts, then reproduce the constructor behavior using the linked CI run and GCC toolchain described in the issue. Compare the __ctors range with .init_array handling and verify that all C++ static constructors are executed on the affected RISC-V board without breaking other BSPs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100