LTO build failure with GCC 13.2.1

Tom Rini trini at konsulko.com
Mon Feb 19 22:14:15 CET 2024


On Fri, Feb 16, 2024 at 10:19:38AM +0530, Sahaj Sarup wrote:

> Hi all,
> 
> Since commit f8cebb4f789c9950caf55a0b73e88049e7a1c3a3 enabled LTO by
> default for imx8m platforms,
> I have been having issues building u-boot.
> I am primarily working on imx8mp instead of imx8mm platforms so the
> bug resolved by that commit doesn't affect me yet.
> But I guess it's a generic issue with u-boot's LTO requirements and GCC 13.
> 
> Build log:
> ```
>   LTO     u-boot
> /usr/bin/aarch64-linux-gnu-ld:
> /usr/lib/gcc/aarch64-linux-gnu/13/libgcc.a(lse-init.o): in function
> `init_have_lse_atomics':
> /builddir/build/BUILD/gcc-13.2.1-20230728/aarch64-linux-gnu/aarch64-linux-gnu/libgcc/../../../gcc-13.2.1-20230728/libgcc/config/aarch64/lse-init.c:46:
> undefined reference to `__getauxval'
> collect2: fatal error: ld terminated with signal 11 [Segmentation
> fault], core dumped
> compilation terminated.
> make: *** [Makefile:1766: u-boot] Error 1
> make: *** Deleting file 'u-boot'
> ```
> 
> GCC Version:
> ```
> $ aarch64-linux-gnu-gcc -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/aarch64-linux-gnu-gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper
> Target: aarch64-linux-gnu
> Configured with: ../gcc-13.2.1-20230728/configure --bindir=/usr/bin
> --build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-
> decimal-float --disable-dependency-tracking --disable-gold
> --disable-libgcj --disable-libgomp --disable-libmpx
> --disable-libquadmat
> h --disable-libssp --disable-libunwind-exceptions --disable-shared
> --disable-silent-rules --disable-sjlj-exceptions --disable-threa
> ds --with-ld=/usr/bin/aarch64-linux-gnu-ld --enable-__cxa_atexit
> --enable-checking=release --enable-gnu-unique-object --enable-init
> fini-array --enable-languages=c,c++ --enable-linker-build-id
> --enable-lto --enable-nls --enable-obsolete --enable-plugin --enable-t
> argets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu
> --includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/
> libexec --localstatedir=/var --mandir=/usr/share/man --prefix=/usr
> --program-prefix=aarch64-linux-gnu- --sbindir=/usr/sbin --shared
> statedir=/var/lib --sysconfdir=/etc --target=aarch64-linux-gnu
> --with-bugurl=http://bugzilla.redhat.com/bugzilla/ --with-gcc-major-
> version-only --with-isl --with-newlib
> --with-plugin-ld=/usr/bin/aarch64-linux-gnu-ld
> --with-sysroot=/usr/aarch64-linux-gnu/sys-root
> --with-system-libunwind --with-system-zlib --without-headers
> --enable-gnu-indirect-function --with-linker-hash-style=gnu
> Thread model: single
> Supported LTO compression algorithms: zlib zstd
> gcc version 13.2.1 20230728 (Red Hat Cross 13.2.1-1) (GCC)

Interesting, we build this platform fine with gcc-13.2.0, so this might
be a regression elsewhere? Please investigate what's required to fix
this, and perhaps if it's a toolchain problem or a compiler problem,
once the "fix" is known in U-Boot.

-- 
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/20240219/d92c1478/attachment.sig>


More information about the U-Boot mailing list