From 58a159a0d6a986aa5b58a0704be3ab58f8686040 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 30 Dec 2023 19:26:03 +0800 Subject: [PATCH] [finsh] support to check static thread size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加检查finsh线程实际使用是否超过当前设定的线程大小 --- components/finsh/SConscript | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/finsh/SConscript b/components/finsh/SConscript index 70f8e5608c..98c7da3151 100644 --- a/components/finsh/SConscript +++ b/components/finsh/SConscript @@ -1,4 +1,5 @@ from building import * +from gcc import GetGCCLikePLATFORM cwd = GetCurrentDir() src = Split(''' @@ -7,14 +8,19 @@ msh.c msh_parse.c ''') +CPPPATH = [cwd] +LOCAL_CFLAGS = '' + +if rtconfig.PLATFORM in GetGCCLikePLATFORM(): + LOCAL_CFLAGS += ' -Wstack-usage=' + str(GetConfigValue('FINSH_THREAD_STACK_SIZE')) # check finsh thread stack size + if GetDepend('MSH_USING_BUILT_IN_COMMANDS'): src += ['cmd.c'] if GetDepend('DFS_USING_POSIX'): src += ['msh_file.c'] -CPPPATH = [cwd] - -group = DefineGroup('Finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH) +group = DefineGroup('Finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, + LOCAL_CFLAGS = LOCAL_CFLAGS) Return('group')