Page 1 of 1

GCC 10 lto

Posted: Tue Jun 20, 2023 9:30 am
by Tuxford
Hi All,
After migration from older GCC to 10.2 linker produces warning regarding incorrect usage of -flto
I found that in ChibiOS it without value but should be with value.
I added next thing and warning doesn't appear anymore. Is it correct way?

Code: Select all

--- a/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk
+++ b/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk
@@ -24,7 +24,7 @@ endif
 
 # Link time optimizations
 ifeq ($(USE_LTO),yes)
-  OPT += -flto
+  OPT += -flto=auto^M
 endif

Re: GCC 10 lto

Posted: Tue Jun 20, 2023 10:31 am
by Giovanni
Hi,

Is this compatible with older GCCs?

Giovanni

Re: GCC 10 lto

Posted: Wed Jun 21, 2023 8:55 am
by Tuxford
I can't check on very old GCC. On GCC 7 auto is good.

Re: GCC 10 lto

Posted: Wed Jun 21, 2023 9:54 am
by Giovanni
Thanks, GCC7 is old enough.

Giovanni

Re: GCC 10 lto

Posted: Sun Jul 02, 2023 9:34 am
by Giovanni
Thanks, change committed.

Giovanni