Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN20220413
rt-thread
提交
82ccbc40
R
rt-thread
项目概览
CSDN20220413
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
82ccbc40
编写于
5月 17, 2023
作者:
G
guozhanxin
提交者:
mysterywolf
5月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support llvm-arm 16.0
上级
48557de1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
149 addition
and
4 deletion
+149
-4
bsp/stm32/stm32l475-atk-pandora/board/SConscript
bsp/stm32/stm32l475-atk-pandora/board/SConscript
+1
-1
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
+33
-0
components/drivers/spi/SConscript
components/drivers/spi/SConscript
+1
-1
components/libc/compilers/common/cstring.c
components/libc/compilers/common/cstring.c
+2
-0
components/libc/compilers/common/extension/SConscript
components/libc/compilers/common/extension/SConscript
+1
-1
components/libc/compilers/picolibc/README.md
components/libc/compilers/picolibc/README.md
+8
-0
components/libc/compilers/picolibc/SConscript
components/libc/compilers/picolibc/SConscript
+29
-0
components/libc/compilers/picolibc/syscall.c
components/libc/compilers/picolibc/syscall.c
+16
-0
libcpu/arm/cortex-m4/SConscript
libcpu/arm/cortex-m4/SConscript
+1
-1
tools/llvm_arm.py
tools/llvm_arm.py
+57
-0
未找到文件。
bsp/stm32/stm32l475-atk-pandora/board/SConscript
浏览文件 @
82ccbc40
...
...
@@ -47,7 +47,7 @@ if GetDepend(['BSP_USING_AUDIO']):
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
PLATFORM
in
[
'gcc'
]:
if
rtconfig
.
PLATFORM
in
[
'gcc'
,
'llvm-arm'
]:
src
+=
[
startup_path_prefix
+
'/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s'
]
elif
rtconfig
.
PLATFORM
in
[
'armcc'
,
'armclang'
]:
src
+=
[
startup_path_prefix
+
'/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s'
]
...
...
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
浏览文件 @
82ccbc40
...
...
@@ -24,6 +24,9 @@ elif CROSS_TOOL == 'keil':
elif
CROSS_TOOL
==
'iar'
:
PLATFORM
=
'iccarm'
EXEC_PATH
=
r
'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.3'
elif
CROSS_TOOL
==
'llvm-arm'
:
PLATFORM
=
'llvm-arm'
EXEC_PATH
=
r
'D:\Progrem\LLVMEmbeddedToolchainForArm-16.0.0-Windows-x86_64\bin'
if
os
.
getenv
(
'RTT_EXEC_PATH'
):
EXEC_PATH
=
os
.
getenv
(
'RTT_EXEC_PATH'
)
...
...
@@ -176,6 +179,36 @@ elif PLATFORM == 'iccarm':
EXEC_PATH
=
EXEC_PATH
+
'/arm/bin/'
POST_ACTION
=
'ielftool --bin $TARGET rtthread.bin'
elif
PLATFORM
==
'llvm-arm'
:
# toolchains
PREFIX
=
'llvm-'
CC
=
'clang'
AS
=
'clang'
AR
=
PREFIX
+
'ar'
CXX
=
'clang++'
LINK
=
'clang'
TARGET_EXT
=
'elf'
SIZE
=
PREFIX
+
'size'
OBJDUMP
=
PREFIX
+
'objdump'
OBJCPY
=
PREFIX
+
'objcopy'
DEVICE
=
' --config armv7em_hard_fpv4_sp_d16.cfg'
CFLAGS
=
DEVICE
CFLAGS
+=
' -mfloat-abi=hard -march=armv7em -mfpu=fpv4-sp-d16'
AFLAGS
=
' -c'
+
DEVICE
+
' -Wa,-mimplicit-it=thumb '
## -x assembler-with-cpp
LFLAGS
=
DEVICE
+
' -Wl,--gc-sections,-Map=rt-thread.map,-u,Reset_Handler -T board/linker_scripts/link.lds'
CPATH
=
''
LPATH
=
''
if
BUILD
==
'debug'
:
CFLAGS
+=
' -O0 -gdwarf-2 -g'
AFLAGS
+=
' -gdwarf-2'
else
:
CFLAGS
+=
' -O2'
CXXFLAGS
=
CFLAGS
POST_ACTION
=
OBJCPY
+
' -O binary $TARGET rtthread.bin
\n
'
+
SIZE
+
' $TARGET
\n
'
def
dist_handle
(
BSP_ROOT
,
dist_dir
):
import
sys
...
...
components/drivers/spi/SConscript
浏览文件 @
82ccbc40
...
...
@@ -29,7 +29,7 @@ if GetDepend('RT_USING_SFUD'):
if
GetDepend
(
'RT_SFUD_USING_SFDP'
):
src_device
+=
[
'sfud/src/sfud_sfdp.c'
]
if
rtconfig
.
PLATFORM
in
[
'gcc'
,
'armclang'
]:
if
rtconfig
.
PLATFORM
in
[
'gcc'
,
'armclang'
,
'llvm-arm'
]:
LOCAL_CFLAGS
+=
' -std=c99'
elif
rtconfig
.
PLATFORM
in
[
'armcc'
]:
LOCAL_CFLAGS
+=
' --c99'
...
...
components/libc/compilers/common/cstring.c
浏览文件 @
82ccbc40
...
...
@@ -19,10 +19,12 @@
*
* @note The bzero() function is deprecated (marked as LEGACY in POSIX. 1-2001).
*/
#ifndef RT_USING_PICOLIBC
void
bzero
(
void
*
s
,
size_t
n
)
{
rt_memset
(
s
,
0
,
n
);
}
#endif
void
bcopy
(
const
void
*
src
,
void
*
dest
,
size_t
n
)
{
...
...
components/libc/compilers/common/extension/SConscript
浏览文件 @
82ccbc40
...
...
@@ -9,7 +9,7 @@ group = []
src
+=
Glob
(
'*.c'
)
if
rtconfig
.
PLATFORM
!=
'gcc'
:
if
rtconfig
.
PLATFORM
!=
'gcc'
and
rtconfig
.
PLATFORM
!=
'llvm-arm'
:
group
=
DefineGroup
(
'Compiler'
,
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
)
list
=
os
.
listdir
(
cwd
)
...
...
components/libc/compilers/picolibc/README.md
0 → 100644
浏览文件 @
82ccbc40
# PICOLIBC (LLVM-ARM) porting for RT-Thread
https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm
https://github.com/picolibc/picolibc
components/libc/compilers/picolibc/SConscript
0 → 100644
浏览文件 @
82ccbc40
import
os
from
building
import
*
from
llvm_arm
import
*
Import
(
'rtconfig'
)
group
=
[]
picolibc_version
=
GetPicoLibcVersion
(
rtconfig
)
if
picolibc_version
and
not
GetDepend
(
'RT_USING_EXTERNAL_LIBC'
):
print
(
'PicoLibc version: '
+
picolibc_version
)
cwd
=
GetCurrentDir
()
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
CPPDEFINES
=
[
'RT_USING_PICOLIBC'
,
'RT_USING_LIBC'
,
'_POSIX_C_SOURCE=1'
,
'__PICOLIBC_ERRNO_FUNCTION=pico_get_errno'
]
# identify this is Newlib, and only enable POSIX.1-1990
# LIBS = ['c', 'm'] # link libc and libm
AddDepend
([
'RT_USING_PICOLIBC'
,
'RT_USING_LIBC'
])
group
=
group
+
DefineGroup
(
'Compiler'
,
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
CPPDEFINES
)
#, LIBS = LIBS)
list
=
os
.
listdir
(
cwd
)
for
d
in
list
:
path
=
os
.
path
.
join
(
cwd
,
d
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
'SConscript'
)):
group
=
group
+
SConscript
(
os
.
path
.
join
(
d
,
'SConscript'
))
Return
(
'group'
)
components/libc/compilers/picolibc/syscall.c
0 → 100644
浏览文件 @
82ccbc40
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-05-17 Flybreak the first version
*/
#include <rtthread.h>
int
pico_get_errno
(
void
)
{
return
rt_get_errno
();
}
libcpu/arm/cortex-m4/SConscript
浏览文件 @
82ccbc40
...
...
@@ -14,7 +14,7 @@ if rtconfig.PLATFORM in ['armcc', 'armclang']:
if
rtconfig
.
PLATFORM
==
'armclang'
:
src
+=
Glob
(
'*_rvds.S'
)
if
rtconfig
.
PLATFORM
in
[
'gcc'
]:
if
rtconfig
.
PLATFORM
in
[
'gcc'
,
'llvm-arm'
]:
src
+=
Glob
(
'*_init.S'
)
src
+=
Glob
(
'*_gcc.S'
)
...
...
tools/llvm_arm.py
0 → 100644
浏览文件 @
82ccbc40
#
# File : llvm_arm.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Change Logs:
# Date Author Notes
# 2023-05-17 Flybreak The first version
import
os
import
re
import
platform
def
GetLLVM_ARMRoot
(
rtconfig
):
exec_path
=
rtconfig
.
EXEC_PATH
lib_path
=
'lib/clang-runtimes/arm-none-eabi'
root_path
=
os
.
path
.
join
(
exec_path
,
'..'
,
lib_path
)
return
root_path
def
CheckHeader
(
rtconfig
,
filename
):
root
=
GetLLVM_ARMRoot
(
rtconfig
)
config
=
re
.
findall
(
r
"--config (.*)\.cfg"
,
rtconfig
.
CFLAGS
)
if
config
:
fn
=
os
.
path
.
join
(
root
,
config
[
0
],
'include'
,
filename
)
if
os
.
path
.
isfile
(
fn
):
return
True
return
False
def
GetPicoLibcVersion
(
rtconfig
):
version
=
None
root
=
GetLLVM_ARMRoot
(
rtconfig
)
if
CheckHeader
(
rtconfig
,
'picolibc.h'
):
# get version from picolibc.h file
config
=
re
.
findall
(
r
"--config (.*)\.cfg"
,
rtconfig
.
CFLAGS
)
fn
=
os
.
path
.
join
(
root
,
config
[
0
],
'include'
,
'picolibc.h'
)
f
=
open
(
fn
,
'r'
)
if
f
:
for
line
in
f
:
if
line
.
find
(
'__PICOLIBC_VERSION__'
)
!=
-
1
and
line
.
find
(
'"'
)
!=
-
1
:
version
=
re
.
search
(
r
'\"([^"]+)\"'
,
line
).
groups
()[
0
]
f
.
close
()
return
version
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录