Skip to content

Commit 2ea776b

Browse files
committed
[gcc] add footprint information when compiling
1 parent d2c12e2 commit 2ea776b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SConscript

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ else:
3030
SrcRemove(src, ['scheduler_up.c'])
3131

3232
LOCAL_CFLAGS = ''
33+
LINKFLAGS = ''
3334

3435
if rtconfig.PLATFORM in ['gcc']: # only for GCC
3536
LOCAL_CFLAGS += ' -Wunused' # unused warning
@@ -41,7 +42,11 @@ if rtconfig.PLATFORM in ['gcc']: # only for GCC
4142
if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
4243
LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
4344
LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
45+
if rtconfig.ARCH not in ['sim']:
46+
LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usage
4447

45-
group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc, CPPDEFINES=['__RTTHREAD__'], LOCAL_CFLAGS=LOCAL_CFLAGS, LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
48+
group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,
49+
LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,
50+
CPPDEFINES=['__RTTHREAD__'], LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
4651

4752
Return('group')

0 commit comments

Comments
 (0)