From 3e4a93cc91692454d9fba54c2494b5de4a4172c4 Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 12 Mar 2019 11:40:53 +0800 Subject: [PATCH] Delete the unused '--keep' link flag when used RT_USED marco. --- components/finsh/SConscript | 9 +-------- src/SConscript | 11 +---------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/components/finsh/SConscript b/components/finsh/SConscript index 639cbebd4a..e1e2b3bbdb 100644 --- a/components/finsh/SConscript +++ b/components/finsh/SConscript @@ -28,19 +28,12 @@ msh_file.c ''') CPPPATH = [cwd] -if rtconfig.CROSS_TOOL == 'keil': - LINKFLAGS = ' --keep *.o(FSymTab)' - - if not GetDepend('FINSH_USING_MSH_ONLY'): - LINKFLAGS = LINKFLAGS + ' --keep *.o(VSymTab) ' -else: - LINKFLAGS = '' if GetDepend('FINSH_USING_MSH'): src = src + msh_src if not GetDepend('FINSH_USING_MSH_ONLY'): src = src + fsh_src -group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) +group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH) Return('group') diff --git a/src/SConscript b/src/SConscript index bb38baa6bd..7f448725a2 100644 --- a/src/SConscript +++ b/src/SConscript @@ -5,15 +5,6 @@ from building import * src = Glob('*.c') CPPPATH = [RTT_ROOT + '/include'] -if rtconfig.CROSS_TOOL == 'keil': - # add more link flags for module and components_init. - LINKFLAGS = '' - if GetDepend('RT_USING_MODULE'): - LINKFLAGS += ' --keep *.o(RTMSymTab) ' - if GetDepend('RT_USING_COMPONENTS_INIT'): - LINKFLAGS += ' --keep *.o(.rti_fn.*) ' -else: - LINKFLAGS = '' if GetDepend('RT_USING_COMPONENTS_INIT') == False: SrcRemove(src, ['components.c']) @@ -38,6 +29,6 @@ if GetDepend('RT_USING_MEMHEAP') == False: if GetDepend('RT_USING_DEVICE') == False: SrcRemove(src, ['device.c']) -group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) +group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH) Return('group')