support llvm-arm 16.0

This commit is contained in:
guozhanxin
2023-05-17 12:09:10 -04:00
committed by Man, Jianting (Meco)
parent 48557de148
commit 82ccbc40db
10 changed files with 149 additions and 4 deletions
@@ -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)
{
@@ -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)
@@ -0,0 +1,8 @@
# PICOLIBC (LLVM-ARM) porting for RT-Thread
https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm
https://github.com/picolibc/picolibc
@@ -0,0 +1,29 @@
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')
@@ -0,0 +1,16 @@
/*
* 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();
}