-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[libc][picolibc] improve gcc picolibc support #8220
Conversation
后续改进点: arm-zephyr-eabi-gcc -xc /dev/null -E -Wp,-v 2>&1 | sed -n 's,^ ,,p'
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/sys-include
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/include ./bin/arm-zephyr-eabi-gcc --specs=arm-zephyr-eabi/lib/picolibc.specs -xc /dev/null -E -Wp,-v 2>&1 | sed -n 's,^ ,,p'
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/../../picolibc/include
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/sys-include
/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/include |
@iDings 可以帮忙用 llvm-arm 试一下这个bsp吗:https://github.com/RT-Thread/rt-thread/tree/master/bsp/renesas/ra8m1-ek 他这个 bsp 好像依赖了 picolibc 的 tls 功能。但是我知道该怎么处理。 |
我也发现这个bsp, llvm-arm编译不过. 我可以看下,看能不能找到原因 |
@Guozhanxin 使用picolibc需要对TLS做些初始化,链接脚本里面需要定义TLS存储信息跟符号 TLS的话GCC+PICOLIBC也是有问题,这个我要看下怎么处理. PICOLIBC参考的链接脚本还需要增对不同的ld还需要设置不同的align |
感谢提交PR PR准备就绪之后请@我review |
@mysterywolf 我感觉现在这个pr就可以review了,tls相关的,下个pr再说吧。 |
我先把这个 #8220 (comment) 做了,这样后面也可以直接使用zephyr sdk的编译工具链验证gcc+picolibc的功能. |
4a183e1
to
7b34daa
Compare
@mysterywolf 帮忙review下改动,我这边现在只在ubuntu下做了验证. 验证方法: diff --git a/bsp/qemu-vexpress-a9/rtconfig.py b/bsp/qemu-vexpress-a9/rtconfig.py
index 77cc9dfb4..391e13f2f 100644
--- a/bsp/qemu-vexpress-a9/rtconfig.py
+++ b/bsp/qemu-vexpress-a9/rtconfig.py
@@ -49,7 +49,9 @@ if PLATFORM == 'gcc':
STRIP = PREFIX + 'strip'
CFPFLAGS = ' -msoft-float'
AFPFLAGS = ' -mfloat-abi=softfp -mfpu=neon'
- DEVICE = ' -march=armv7-a -mtune=cortex-a7 -ftree-vectorize -ffast-math -funwind-tables -fno-strict-aliasing'
+ DEVICE = ''
+ DEVICE += ' --specs=picolibc.specs --picolibc-prefix=' + EXEC_PATH + '/../'
+ DEVICE += ' -march=armv7-a -mtune=cortex-a7 -ftree-vectorize -ffast-math -funwind-tables -fno-strict-aliasing'
CXXFLAGS= DEVICE + CFPFLAGS + ' -Wall -fdiagnostics-color=always'
CFLAGS = DEVICE + CFPFLAGS + ' -Wall -Wno-cpp -std=gnu99 -D_POSIX_SOURCE -fdiagnostics-color=always' 按理说可以不使用 |
感谢提交PR! |
你好 这个PR改出问题了 https://club.rt-thread.org/ask/question/dfc88acb52dfbaba.html 复现方法 进入任何一个bsp 例如stm32 直接menuconfig刷新一下配置 然后scons 编译即可发现编译报错 麻烦修复一下 谢谢! |
@iDings 麻烦看一下这个问题,好像是 run 在 python2.x 的版本不支持 |
@mysterywolf @Guozhanxin 抱歉刚看到, 我看下 |
如果python支持2.0的话, 建议现在CI检查的时候也是python2.0的版本, 然后建议有文档说明 |
你好 这个问题已经修复
…---Original---
From: ***@***.***>
Date: Wed, Nov 22, 2023 11:35 AM
To: ***@***.***>;
Cc: "Meco ***@***.******@***.***>;
Subject: Re: [RT-Thread/rt-thread] [libc][picolibc] improve gcc picolibcsupport (PR #8220)
如果python支持2.0的话, 建议现在CI检查的时候也是python2.0的版本
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@mysterywolf 🤝 抱歉哈 |
你好 之前提交了个PR并没有彻底解决这个问题 #8254 请最好确认一下Python2环境可以正常执行,不要用.run这个方法,这个方法只在python3里有,请用subprocess.Popen代替 |
好的, 我确认下 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
现阶段的绝大部分的gcc编译工具链默认都是使用newlibc,crosstool-ng可以制作
带picolibc的gcc编译工具链, 使用该工具链接rt-thread无法编译编译
你的解决方案是什么 (what is your solution)
增加部分缺失的picolibc依赖接口:https://github.com/picolibc/picolibc/blob/main/doc/os.md
在什么测试环境下测试通过 (what is the test environment)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up