You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/26 06:03:33 UTC
[GitHub] [incubator-nuttx] anchao opened a new pull request, #7187: arm/armlink: add support of link time optimization(lto)
anchao opened a new pull request, #7187:
URL: https://github.com/apache/incubator-nuttx/pull/7187
## Summary
arm/armlink: add support of link time optimization(lto)
Optimization goal(Code size)
```
Smaller GCC(-Os) GCC(-flto -Os) CLANG(-flto -Oz) ARMCLANG(-flto -Oz/-Omin)
lm3s6965-ek/qemu-flat(Cortex-M3) 208662 193893 199525 195464
sabre-6quad/smp(Cortex-A9) 131360 122500 N/A 123988
-7.60% -4.57% -6.75%
Faster performance GCC(-O3) GCC(-flto -O3) CLANG(-flto -Ofast) ARMCLANG(-flto -Ofast) ARMCLANG(-flto -Omax)
lm3s6965-ek/qemu-flat(Cortex-M3) 257502 296364 369465 346696 384204
sabre-6quad/smp(Cortex-A9) 166520 196004 N/A 207908 224140
+15.00% +43.40% +34.60% +49.20%
```
Reference:
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-O--armclang-
![img_v2_6a717f29-4d5e-4929-b22b-e820cf903cdl](https://user-images.githubusercontent.com/758493/192204290-984a55b9-1dfd-4ad1-a70c-603ec8600c0b.png)
Signed-off-by: chao an <an...@xiaomi.com>
## Impact
N/A
## Testing
lm3s6965-ek/qemu-flat(Cortex-M3)
sabre-6quad/smp(Cortex-A9)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #7187: arm/armlink: add support of link time optimization(lto)
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7187:
URL: https://github.com/apache/incubator-nuttx/pull/7187#discussion_r979608681
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -220,9 +226,10 @@ ifneq ($(CONFIG_CXX_RTTI),y)
endif
ARCHOPTIMIZATION += -fno-common -Wall -Wshadow -Wundef
-ARCHOPTIMIZATION += -nostdlib
-ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),)
+ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
+ ARCHOPTIMIZATION += -nostdlib
Review Comment:
Yes, this is a regression issue, PR https://github.com/apache/incubator-nuttx/pull/7100 added this option but non-armclang toolchains need to use the standard system startup files or libraries, this change will broken GCC compiler if enable -flto.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7187: arm/armlink: add support of link time optimization(lto)
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7187:
URL: https://github.com/apache/incubator-nuttx/pull/7187
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7187: arm/armlink: add support of link time optimization(lto)
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7187:
URL: https://github.com/apache/incubator-nuttx/pull/7187#issuecomment-1259223464
gcc/clang related change: https://github.com/apache/incubator-nuttx/pull/6123
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7187: arm/armlink: add support of link time optimization(lto)
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7187:
URL: https://github.com/apache/incubator-nuttx/pull/7187#discussion_r979603370
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -220,9 +226,10 @@ ifneq ($(CONFIG_CXX_RTTI),y)
endif
ARCHOPTIMIZATION += -fno-common -Wall -Wshadow -Wundef
-ARCHOPTIMIZATION += -nostdlib
-ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),)
+ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
+ ARCHOPTIMIZATION += -nostdlib
Review Comment:
So till now this flag was added for all cases, but now only in case of ARM CLANG?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org