FS#75731 - gnu-efi [gcc] - lto prevents refind linking
Attached to Project:
Arch Linux
Opened by Gene (GeneC) - Monday, 29 August 2022, 16:03 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 03 May 2023, 20:56 GMT
Opened by Gene (GeneC) - Monday, 29 August 2022, 16:03 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 03 May 2023, 20:56 GMT
|
Details
Description:
After the addition of the 2 lto flags in gnu-efi package, refind no longer builds against it. Tooling is gcc not clang. The issue is described in more detail in refind upstream report : https://sourceforge.net/p/refind/discussion/general/thread/ba04d306d3/ Perhaps there is a better way, but what I found did fix the problem, was to rebuild gnu-efi with CFLAGS="-O2". There may be a way to build refind against the current gnu-efi with "-flto -ffat-lto-objects" but I was unable to find it. This may or may not have anything to do with some of the gnu-efi source, notably crt0-efi-x86_64.S, being assembly code not C - but that's just a very wild guess. |
This task depends upon
Closed by Toolybird (Toolybird)
Wednesday, 03 May 2023, 20:56 GMT
Reason for closing: Fixed
Additional comments about closing: gnu-efi 3.0.17-2
Wednesday, 03 May 2023, 20:56 GMT
Reason for closing: Fixed
Additional comments about closing: gnu-efi 3.0.17-2
rebuilding gnu-efi as I said above with CFLAGS='-O2'
fixes the problem:
First few lines of errors:
/usr/bin/ld: /usr/lib/libefi.a(data.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(data.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(dpath.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(dpath.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(entry.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(entry.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(error.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(error.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(guid.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(guid.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(hand.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(hand.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(init.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(init.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(misc.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(misc.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(print.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(print.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(str.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(str.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(rtdata.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/libefi.a(rtdata.o): plugin needed to handle lto object
/usr/bin/ld: /usr/lib/crt0-efi-x86_64.o: in function `_start':
/build/gnu-efi/src/gnu-efi-3.0.17//gnuefi/crt0-efi-x86_64.S:59: undefined reference to `_entry'
Maybe you have better solution.