summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2024-03-29 16:28:39 -0400
committerMeco Man <[email protected]>2024-03-30 02:07:34 -0400
commitefb7f2c1cf3c94008b6c22c3a94a09432da7ba5a (patch)
tree065b8c548c087c3638512f9b52981dd3d269ac62
parent9a1996ef5979f32052a762464416168c9cf22470 (diff)
[gcc] add footprint information when compiling
-rw-r--r--src/SConscript7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/SConscript b/src/SConscript
index f8dc5248ca..9e84a4c91a 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -30,6 +30,7 @@ else:
SrcRemove(src, ['scheduler_up.c'])
LOCAL_CFLAGS = ''
+LINKFLAGS = ''
if rtconfig.PLATFORM in ['gcc']: # only for GCC
LOCAL_CFLAGS += ' -Wunused' # unused warning
@@ -41,7 +42,11 @@ if rtconfig.PLATFORM in ['gcc']: # only for GCC
if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
+ if rtconfig.ARCH not in ['sim']:
+ LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usage
-group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc, CPPDEFINES=['__RTTHREAD__'], LOCAL_CFLAGS=LOCAL_CFLAGS, LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
+group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,
+ LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,
+ CPPDEFINES=['__RTTHREAD__'], LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
Return('group')