FS#73467 - [freebasic] Error: "plugin needed to handle lto object"
Attached to Project:
Community Packages
Opened by Martin Schnitkemper (Martin-MS) - Sunday, 23 January 2022, 11:53 GMT
Last edited by Felix Yan (felixonmars) - Tuesday, 15 February 2022, 23:52 GMT
Opened by Martin Schnitkemper (Martin-MS) - Sunday, 23 January 2022, 11:53 GMT
Last edited by Felix Yan (felixonmars) - Tuesday, 15 February 2022, 23:52 GMT
|
Details
Description: After update to version 1.09.0 I got on every
project the error
| /usr/bin/../bin/ld: /usr/bin/../lib/freebasic/linux-x86_64/fbrt0.o: plugin needed to handle lto object. After downgrade to version 1.08.1 all works well for me. I tried then to build the package again in a clean chroot from the official PKGBUILD and got the same error during the build process (lines before and after the problem occurs): | LINK bin/fbc | AR lib/freebasic/linux-x86_64/libfb.a | AR lib/freebasic/linux-x86_64/libfbpic.a | /usr/bin/../bin/ld: /usr/bin/../lib/freebasic/linux-x86_64/fbrt0.o: plugin needed to handle lto object | /usr/bin/../bin/ld: /usr/bin/../lib/freebasic/linux-x86_64/fbrt0.o: plugin needed to handle lto object | /usr/bin/../bin/ld: src/compiler/obj/linux-x86_64/ast-gosub.o: in function `TSTRSETITEM::operator=(TSTRSETITEM const&)' * package version(s): 1.09.0-1 * link to upstream bug report, if any: https://github.com/freebasic/fbc/issues/354 Steps to reproduce: Create a simple file "example.bas" with a line "? Hello World" and feed the compiler with it, and it result in the error. The same happen if you try to build the package from official sources. Might be some missing dependencies installed on the packagers system but not in a clean environment. |
This task depends upon
Closed by Felix Yan (felixonmars)
Tuesday, 15 February 2022, 23:52 GMT
Reason for closing: Fixed
Additional comments about closing: 1.09.0-2
Tuesday, 15 February 2022, 23:52 GMT
Reason for closing: Fixed
Additional comments about closing: 1.09.0-2
| sudo makechrootpkg -cnr $CHROOT -I /var/cache/pacman/pkg/freebasic-1.08.1-1-x86_64.pkg.tar.zst
I was able to build the package. After all, namcap report these warnings:
| freebasic W: ELF file ('usr/bin/fbc') lacks FULL RELRO, check LDFLAGS.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0.o') lacks FULL RELRO, check LDFLAGS.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0pic.o') lacks FULL RELRO, check LDFLAGS.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0.o') is unstripped.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0pic.o') is unstripped.
| freebasic W: ELF file ('usr/bin/fbc') lacks PIE.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0.o') lacks PIE.
| freebasic W: ELF file ('usr/lib/freebasic/linux-x86_64/fbrt0pic.o') lacks PIE.
| freebasic W: Unused shared library '/usr/lib/libdl.so.2' by file ('usr/bin/fbc')
Not sure if it helps, but the warnings belong to the 'fbrt0.o' mentioned in the error while compiling.
I could solve the problem while adding
| options=('!lto')
to PKGBUILD and rebuild the package using the last working version 1.08.1-1. After all, I got a working version 1.09.0 now.
I agree with the FreeBasic contributors since they advice to use the bootstrap concept instead of setting a dependency on itself. As we have seen in this case, builds are no longer possible if the previous package is corrupt.
* set "options=('!lto')" to prevent the LTO error
* removed the dependency of "freebasic"
* changed the source to the archive that contents the bootstrap and sources
* build the target "bootstrap" as adviced from the FreeBasic developers; it's plain C so there is no more need to have an existing fbc
* compile & install fbc from sources
Feel free to try it out, mandatory is only the first change for a working fbc.