diff mbox series

[u-boot,v2,32/38] ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards)

Message ID 20210312103429.25895-33-marek.behun@nic.cz
State Superseded
Delegated to: Tom Rini
Headers show
Series U-Boot LTO (Sandbox + Some ARM boards) | expand

Commit Message

Marek Behún March 12, 2021, 10:34 a.m. UTC
Adam Ford says that DM3730 needs board.c compiled without LTO flags.

Also add clock.c, since it says in Makefile that it need different
flags.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Suggested-by: Adam Ford <aford173@gmail.com>
---
 arch/arm/mach-omap2/omap3/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Comments

Adam Ford March 12, 2021, 1:43 p.m. UTC | #1
On Fri, Mar 12, 2021 at 4:35 AM Marek Behún <marek.behun@nic.cz> wrote:
>
> Adam Ford says that DM3730 needs board.c compiled without LTO flags.
>
> Also add clock.c, since it says in Makefile that it need different
> flags.
>

Tested-by: Adam Ford <aford173@gmail.com> #omap3_logic

> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Suggested-by: Adam Ford <aford173@gmail.com>
> ---
>  arch/arm/mach-omap2/omap3/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/omap3/Makefile b/arch/arm/mach-omap2/omap3/Makefile
> index 91ed8ebc9f..7d22f04bbf 100644
> --- a/arch/arm/mach-omap2/omap3/Makefile
> +++ b/arch/arm/mach-omap2/omap3/Makefile
> @@ -5,10 +5,12 @@
>
>  # If clock.c is compiled for Thumb2, then it fails on OMAP3530
>  CFLAGS_clock.o += -marm
> +CFLAGS_REMOVE_clock.o := $(LTO_CFLAGS)

I have two OMAP3530 boards.  I'll test that this weekend.  I think I
even have them configured for Thumb2

adam

>
>  obj-y  := lowlevel_init.o
>
>  obj-y  += board.o
> +CFLAGS_REMOVE_board.o := $(LTO_CFLAGS)
>  obj-y  += boot.o
>  obj-y  += clock.o
>  obj-y  += sys_info.o
> --
> 2.26.2
>
Adam Ford March 13, 2021, 3:23 p.m. UTC | #2
On Fri, Mar 12, 2021 at 7:43 AM Adam Ford <aford173@gmail.com> wrote:
>
> On Fri, Mar 12, 2021 at 4:35 AM Marek Behún <marek.behun@nic.cz> wrote:
> >
> > Adam Ford says that DM3730 needs board.c compiled without LTO flags.
> >
> > Also add clock.c, since it says in Makefile that it need different
> > flags.
> >
>
> Tested-by: Adam Ford <aford173@gmail.com> #omap3_logic
>
> > Signed-off-by: Marek Behún <marek.behun@nic.cz>
> > Suggested-by: Adam Ford <aford173@gmail.com>
> > ---
> >  arch/arm/mach-omap2/omap3/Makefile | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/mach-omap2/omap3/Makefile b/arch/arm/mach-omap2/omap3/Makefile
> > index 91ed8ebc9f..7d22f04bbf 100644
> > --- a/arch/arm/mach-omap2/omap3/Makefile
> > +++ b/arch/arm/mach-omap2/omap3/Makefile
> > @@ -5,10 +5,12 @@
> >
> >  # If clock.c is compiled for Thumb2, then it fails on OMAP3530
> >  CFLAGS_clock.o += -marm
> > +CFLAGS_REMOVE_clock.o := $(LTO_CFLAGS)
>
> I have two OMAP3530 boards.  I'll test that this weekend.  I think I
> even have them configured for Thumb2

I have tested this on omap35_logic_somlv and the LTO flag removal
isn't necessary for the clock.o
Having the clock built with LTO saves 239 bytes in SPL with my
compiler.  It's not a huge savings, but in SPL, we need as much as
possible.

adam

>
> adam
>
> >
> >  obj-y  := lowlevel_init.o
> >
> >  obj-y  += board.o
> > +CFLAGS_REMOVE_board.o := $(LTO_CFLAGS)
> >  obj-y  += boot.o
> >  obj-y  += clock.o
> >  obj-y  += sys_info.o
> > --
> > 2.26.2
> >
Marek Behún March 13, 2021, 4:05 p.m. UTC | #3
On Sat, 13 Mar 2021 09:23:05 -0600
Adam Ford <aford173@gmail.com> wrote:

> I have tested this on omap35_logic_somlv and the LTO flag removal
> isn't necessary for the clock.o
> Having the clock built with LTO saves 239 bytes in SPL with my
> compiler.  It's not a huge savings, but in SPL, we need as much as
> possible.

So I can drop this patch?
Marek
Adam Ford March 13, 2021, 5:34 p.m. UTC | #4
On Sat, Mar 13, 2021 at 10:05 AM Marek Behun <marek.behun@nic.cz> wrote:
>
> On Sat, 13 Mar 2021 09:23:05 -0600
> Adam Ford <aford173@gmail.com> wrote:
>
> > I have tested this on omap35_logic_somlv and the LTO flag removal
> > isn't necessary for the clock.o
> > Having the clock built with LTO saves 239 bytes in SPL with my
> > compiler.  It's not a huge savings, but in SPL, we need as much as
> > possible.
>
> So I can drop this patch?

Drop the LTO stuff for clock.o, but keep the LTO stuff for board.o

adam
> Marek
diff mbox series

Patch

diff --git a/arch/arm/mach-omap2/omap3/Makefile b/arch/arm/mach-omap2/omap3/Makefile
index 91ed8ebc9f..7d22f04bbf 100644
--- a/arch/arm/mach-omap2/omap3/Makefile
+++ b/arch/arm/mach-omap2/omap3/Makefile
@@ -5,10 +5,12 @@ 
 
 # If clock.c is compiled for Thumb2, then it fails on OMAP3530
 CFLAGS_clock.o += -marm
+CFLAGS_REMOVE_clock.o := $(LTO_CFLAGS)
 
 obj-y	:= lowlevel_init.o
 
 obj-y	+= board.o
+CFLAGS_REMOVE_board.o := $(LTO_CFLAGS)
 obj-y	+= boot.o
 obj-y	+= clock.o
 obj-y	+= sys_info.o