xiaoxiang781216 commented on a change in pull request #1558:
URL: https://github.com/apache/incubator-nuttx/pull/1558#discussion_r468562043
##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -31,6 +31,10 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -O2 -fno-strict-aliasing
endif
+ifeq ($(CONFIG_STACK_CANARIES),y)
+ ARCHOPTIMIZATION += -fstack-protector-all
+endif
Review comment:
> Just an FYI with armv7-m/arm_stackcheck.c the code size blows up and
performance drops considerably, there is also a reserved register that needs
initialization. What are the effect of SSP in these terms? Do you have any
metrics?
No, SSP don't need resolve a special register.
Here is the data for stm32f4discovery:canard without SSP:
```
text data bss dec hex filename
80900 320 3572 84792 14b38 nuttx
```
and with SSP(-fstack-protector):
```
text data bss dec hex filename
81604 320 3572 85496 14df8 nuttx
```
and with SSP(-fstack-protector-strong):
```
text data bss dec hex filename
85624 320 3572 89516 15dac nuttx
```
and with SSP(-fstack-protector-all):
```
text data bss dec hex filename
107092 320 3572 110984 1b188 nuttx
```
Not only the size and speed is much better than the old approach, the
trigger is also much eariler(function return .v.s. task switch).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]