diff mbox series

[5/6] pogo_v4: Disable LTO

Message ID 20221122173158.2231821-5-trini@konsulko.com
State Accepted
Commit 6caf6f5c83db773c068a5ad1042290c0a5f5bcc8
Delegated to: Tom Rini
Headers show
Series [1/6] buildman: Fetch 12.2.0 toolchains by default | expand

Commit Message

Tom Rini Nov. 22, 2022, 5:31 p.m. UTC
With gcc-12.2 we now get:
lib/zlib/inflate.c:360: undefined reference to `__gnu_thumb1_case_si'
when building this platform. This seems like some odd problem with LTO
and Thumb, but since the platform continues to link, I assume it's
within size constraints, so lets just disable LTO for now.

Cc: Tony Dinh <mibodhi@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 configs/pogo_v4_defconfig | 1 -
 1 file changed, 1 deletion(-)

Comments

Tony Dinh Nov. 22, 2022, 9:09 p.m. UTC | #1
Resend to include the mailing list!

Tony

On Tue, Nov 22, 2022 at 11:58 AM Tony Dinh <mibodhi@gmail.com> wrote:
>
> Hi Tom,
>
> On Tue, Nov 22, 2022 at 9:32 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > With gcc-12.2 we now get:
> > lib/zlib/inflate.c:360: undefined reference to `__gnu_thumb1_case_si'
> > when building this platform. This seems like some odd problem with LTO
> > and Thumb, but since the platform continues to link, I assume it's
> > within size constraints, so lets just disable LTO for now.
>
> We don't have a hard size constraint for this board. Thumb and LTO
> were to help keep the image 512K or less (by convention, for some
> downstream scripts).
>
> Thanks,
> Acked-by:  Tony Dinh <mibodhi@gmail.com>
>
> >
> > Cc: Tony Dinh <mibodhi@gmail.com>
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  configs/pogo_v4_defconfig | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/configs/pogo_v4_defconfig b/configs/pogo_v4_defconfig
> > index 3b08cb7b1d14..c4b7f7c31471 100644
> > --- a/configs/pogo_v4_defconfig
> > +++ b/configs/pogo_v4_defconfig
> > @@ -17,7 +17,6 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogoplug-series-4"
> >  CONFIG_SYS_PROMPT="Pogo_V4> "
> >  CONFIG_IDENT_STRING="\nPogoplug V4"
> >  CONFIG_SYS_LOAD_ADDR=0x800000
> > -CONFIG_LTO=y
> >  CONFIG_DISTRO_DEFAULTS=y
> >  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
> > --
> > 2.25.1
> >
Simon Glass Nov. 23, 2022, 2:09 a.m. UTC | #2
On Tue, 22 Nov 2022 at 10:32, Tom Rini <trini@konsulko.com> wrote:
>
> With gcc-12.2 we now get:
> lib/zlib/inflate.c:360: undefined reference to `__gnu_thumb1_case_si'
> when building this platform. This seems like some odd problem with LTO
> and Thumb, but since the platform continues to link, I assume it's
> within size constraints, so lets just disable LTO for now.
>
> Cc: Tony Dinh <mibodhi@gmail.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  configs/pogo_v4_defconfig | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Nov. 23, 2022, 1:45 p.m. UTC | #3
On Tue, Nov 22, 2022 at 01:09:55PM -0800, Tony Dinh wrote:
> Resend to include the mailing list!
> 
> Tony
> 
> On Tue, Nov 22, 2022 at 11:58 AM Tony Dinh <mibodhi@gmail.com> wrote:
> >
> > Hi Tom,
> >
> > On Tue, Nov 22, 2022 at 9:32 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > With gcc-12.2 we now get:
> > > lib/zlib/inflate.c:360: undefined reference to `__gnu_thumb1_case_si'
> > > when building this platform. This seems like some odd problem with LTO
> > > and Thumb, but since the platform continues to link, I assume it's
> > > within size constraints, so lets just disable LTO for now.
> >
> > We don't have a hard size constraint for this board. Thumb and LTO
> > were to help keep the image 512K or less (by convention, for some
> > downstream scripts).

Ah, well, uh-oh.  Then we needed to add:
CONFIG_HAS_BOARD_SIZE_LIMIT=y
CONFIG_BOARD_SIZE_LIMIT=524288
to the config. Which is fine now, but without both LTO and thumb, we now
are too big. So this means digging harder at that error message.  Which
in turn shows that 806f86bd826e ("arm: lib: Import Thumb1 functions") is
where we imported the __gnu_thumb1_case_* functions we have now, and
need to do similar work to import (and then do the follow-up
improvements to) __gnu_thumb1_case_si. Can you please take a look at
that? FWIW, the gcc-12.2.0 toolchain I'm using is just
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-arm-linux-gnueabi.tar.xz
Tony Dinh Nov. 23, 2022, 10:34 p.m. UTC | #4
Hi Tom,

On Wed, Nov 23, 2022 at 5:45 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Tue, Nov 22, 2022 at 01:09:55PM -0800, Tony Dinh wrote:
> > Resend to include the mailing list!
> >
> > Tony
> >
> > On Tue, Nov 22, 2022 at 11:58 AM Tony Dinh <mibodhi@gmail.com> wrote:
> > >
> > > Hi Tom,
> > >
> > > On Tue, Nov 22, 2022 at 9:32 AM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > With gcc-12.2 we now get:
> > > > lib/zlib/inflate.c:360: undefined reference to `__gnu_thumb1_case_si'
> > > > when building this platform. This seems like some odd problem with LTO
> > > > and Thumb, but since the platform continues to link, I assume it's
> > > > within size constraints, so lets just disable LTO for now.
> > >
> > > We don't have a hard size constraint for this board. Thumb and LTO
> > > were to help keep the image 512K or less (by convention, for some
> > > downstream scripts).
>
> Ah, well, uh-oh.  Then we needed to add:
> CONFIG_HAS_BOARD_SIZE_LIMIT=y
> CONFIG_BOARD_SIZE_LIMIT=524288
> to the config. Which is fine now, but without both LTO and thumb, we now
> are too big. So this means digging harder at that error message.  Which
> in turn shows that 806f86bd826e ("arm: lib: Import Thumb1 functions") is
> where we imported the __gnu_thumb1_case_* functions we have now, and
> need to do similar work to import (and then do the follow-up
> improvements to) __gnu_thumb1_case_si. Can you please take a look at
> that? FWIW, the gcc-12.2.0 toolchain I'm using is just
> https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-arm-linux-gnueabi.tar.xz

I think I was not clear in my previous response. We did not implement
a hard size constraint, but only tried to keep it small at 512K. If it
grows larger, it's OK. Others and I just need to modify the flashing
script, which is not a big deal. So removing LTO and Thumb is fine to
get through this gcc build problem. Nothing will break because it is
still small enough at 670K (built using gcc 11).

I'm not well versed in troubleshooting this type of compiler problem.
I could try, but I think someone like Simon would be able to solve it
quicker. Please let me know what you think.

All the best,
Tony

>
> --
> Tom
diff mbox series

Patch

diff --git a/configs/pogo_v4_defconfig b/configs/pogo_v4_defconfig
index 3b08cb7b1d14..c4b7f7c31471 100644
--- a/configs/pogo_v4_defconfig
+++ b/configs/pogo_v4_defconfig
@@ -17,7 +17,6 @@  CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogoplug-series-4"
 CONFIG_SYS_PROMPT="Pogo_V4> "
 CONFIG_IDENT_STRING="\nPogoplug V4"
 CONFIG_SYS_LOAD_ADDR=0x800000
-CONFIG_LTO=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000