summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2024-03-29 16:28:39 -0400
committerMeco Man <[email protected]>2024-04-16 22:38:10 -0400
commit403c13dc9aa49307da3a2f9e38b261334316316f (patch)
tree060076214cc6301e2ad10d735d4158ced17fb281 /src
parent50d72486271777ff13eee9b533e4841695496d60 (diff)
[gcc] add footprint information when compiling
Diffstat (limited to 'src')
-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')