Skip to content

Commit 9a146e8

Browse files
committed
[gcc] add footprint information when compiling
1 parent d2c12e2 commit 9a146e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ else:
3030
SrcRemove(src, ['scheduler_up.c'])
3131

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

3435
if rtconfig.PLATFORM in ['gcc']: # only for GCC
36+
LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usage
3537
LOCAL_CFLAGS += ' -Wunused' # unused warning
3638
LOCAL_CFLAGS += ' -Wformat -Wformat-security' # printf/scanf format warning
3739
LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning
@@ -42,6 +44,8 @@ if rtconfig.PLATFORM in ['gcc']: # only for GCC
4244
LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
4345
LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
4446

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

4751
Return('group')

0 commit comments

Comments
 (0)