GCC 10 lto Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
Tuxford
Posts: 26
Joined: Fri Nov 06, 2020 3:28 pm
Has thanked: 4 times
Been thanked: 4 times

GCC 10 lto

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: GCC 10 lto

Post by Giovanni »

Hi,

Is this compatible with older GCCs?

Giovanni
Tuxford
Posts: 26
Joined: Fri Nov 06, 2020 3:28 pm
Has thanked: 4 times
Been thanked: 4 times

Re: GCC 10 lto

Post by Tuxford »

I can't check on very old GCC. On GCC 7 auto is good.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: GCC 10 lto

Post by Giovanni »

Thanks, GCC7 is old enough.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: GCC 10 lto

Post by Giovanni »

Thanks, change committed.

Giovanni
Post Reply