[PATCH 27/31] Makefile: Disable LTO when building with MSYS2

Tom Rini trini at konsulko.com
Thu Apr 27 19:34:53 CEST 2023


On Thu, Apr 27, 2023 at 10:25:13AM -0600, Simon Glass wrote:
> Hi Pali,
> 
> On Wed, 26 Apr 2023 at 01:07, Pali Rohár <pali at kernel.org> wrote:
> >
> > On Tuesday 25 April 2023 19:04:10 Simon Glass wrote:
> > > Hi Pali,
> > >
> > > On Tue, 25 Apr 2023 at 10:28, Pali Rohár <pali at kernel.org> wrote:
> > > >
> > > > On Monday 24 April 2023 17:08:32 Simon Glass wrote:
> > > > > This creates a lot of errors of the form:
> > > > >
> > > > > `__stack_chk_fail' referenced in section `.text' of ...ltrans.o: defined
> > > > >    in discarded section `.text' of common/stackprot.o (symbol from plugin)
> > > >
> > > > This issue should be rather fixed...
> > > >
> > > > > Drop LTO for now.
> > > >
> > > > ... and until it happens is not CONFIG_LTO for disabling enough?
> > > >
> > > > LTO does not work for more other boards / platforms and it is just _not_
> > > > enabled via CONFIG_LTO in those cases...
> > >
> > > The thing is, LTO is enabled for sandbox normally (clang and gcc). It
> > > is just the MSYS2 platform where there are problems.
> >
> > So what about having CONFIG_LTO by default 'n' for CONFIG_MSYS2?
> 
> But that would require creating a new board. I am trying to use the
> same board, just building it in a different environment.

I think we need to make CONFIG_LTO depend on CC_IS_GCC for now as it
also doesn't work (but could be addressed) for CC_IS_CLANG.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230427/746ebb7d/attachment.sig>


More information about the U-Boot mailing list