FS#75290 - [uudeview] The *.o objects have LTO version 11.0 instead of 12.0

Attached to Project: Arch Linux
Opened by Klaus Alexander Seistrup (kseistrup) - Sunday, 10 July 2022, 13:39 GMT
Last edited by Toolybird (Toolybird) - Monday, 23 October 2023, 05:09 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:

Linking in any of “/usr/lib/uudeview/*.o” with gcc v12 fails because, as the compiler puts it:

»
lto1: fatal error: bytecode stream in file ‘/usr/lib/uudeview/fptools.o’ generated with LTO version 11.0 instead of the exp
ected 12.0
compilation terminated.
«

Additional info:
* package version(s)

community/uudeview 0.5.20-16
core/gcc 12.1.0-2

* config and/or log files etc.

The error was seen when attempting to compile aur/slrn-snapshot: https://aur.archlinux.org/packages/slrn-snapshot

* link to upstream bug report, if any

Steps to reproduce:

1. Install community/uudeview then compile the attached minimal uufail.c thusly: gcc -o uufail uufail.c /usr/lib/uudeview/*.o

2. Observe the error: »lto1: fatal error: bytecode stream in file ‘/usr/lib/uudeview/fptools.o’ generated with LTO version 11.0 instead of the expected 12.0«
   uufail.c (0.1 KiB)
This task depends upon

Closed by  Toolybird (Toolybird)
Monday, 23 October 2023, 05:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  uudeview 20230502-3
Comment by Toolybird (Toolybird) - Saturday, 23 July 2022, 00:21 GMT
Probably just needs a rebuild.

Also, when updated to 0.5.20-16, this was added to the configure invocation:

CFLAGS="-ffat-lto-objects"

According to [1], it was supposed to be CFLAGS+=" -ffat-lto-objects"

i.e. added to existing CFLAGS, not replace them.

[1] https://archlinux.org/todo/lto-fat-objects/
Comment by Klaus Alexander Seistrup (kseistrup) - Sunday, 11 September 2022, 07:31 GMT
It's not that simple, unfortunately. It's a very old source code, and some of the warnings at compile time has now been elevated to errors because of the “-Werror=format-security” compiler flag (they are errors like “I see "%d", but it should be "%ld"). The source won't compile with the current $CFLAGS until it's been given a throrough overhaul.
Comment by loqs (loqs) - Sunday, 11 September 2022, 10:37 GMT
@kseistrup if you apply the attached diff does the package then build successfully?
Comment by Klaus Alexander Seistrup (kseistrup) - Sunday, 11 September 2022, 12:04 GMT
@loqs

Unfortunately not. There are still many places like "=yend size=%d part=%d pcrc32=%08lx" where "%d" should have been "%ld" (and places where "%d" is the right thing, so a simple search-replace will noty work).
Comment by Klaus Alexander Seistrup (kseistrup) - Sunday, 11 September 2022, 12:06 GMT
Erratum: The "%d" in "size=%d" should be "%ld", but the "part=%d" is correct.
Comment by loqs (loqs) - Sunday, 11 September 2022, 17:48 GMT
With the patch I supplied applied package builds for me in a clean chroot. Please see attached logs.
Comment by Klaus Alexander Seistrup (kseistrup) - Sunday, 11 September 2022, 17:54 GMT
The build succeeds because the makepkg CFLAGS have been replaced by the LTOFLAGS only (which has always been an error in this PKGBUILD file).
Comment by loqs (loqs) - Sunday, 11 September 2022, 18:45 GMT
Please try this updated patch.
Comment by loqs (loqs) - Monday, 12 September 2022, 20:40 GMT
Updated diff, patches from Gentoo:
1. Multiple bugfix patch:
* Don't force overwrite mode if auto-rename enabled
* Don't ignore special chars when parsing MIME.
* Fix for #320541 also fixes #242999.
* Incorporate suspicious-file patch from Peter Muir.
2. CVE-2004-2265 patch
3. CVE-2008-2266 patch
4. Prefer rename to copy patch.
5. Makefile patch
6. Missing function signature patch

Not from Gentoo the format security patch.
Comment by Klaus Alexander Seistrup (kseistrup) - Tuesday, 13 September 2022, 07:53 GMT
Perhaps I'm doing something wrong (I'm not a dev, just a casual user), but building aborts here because of “undefined reference to ‘matherr’”: the tcl/uutcl.c file has “extern int matherr();” but shouldn't it just “#include <math.h>” instead?

Comment by loqs (loqs) - Tuesday, 13 September 2022, 17:08 GMT
Fix for previous diff adjust patch call as format security patch is now named uudeview-0.5.20-format-security.patch.
Comment by Klaus Alexander Seistrup (kseistrup) - Saturday, 06 May 2023, 08:22 GMT
Package needs a rebuild:

After the `gcc` package has been updated to v13.*, the linker is now complaining that `*.o` (pkgver=0.5.20-17) has LTO objects of version 12 when it expects version 13.

Comment by Toolybird (Toolybird) - Saturday, 21 October 2023, 19:09 GMT
Merging dupe  FS#80043  here
Comment by Sergej Pupykin (sergej) - Saturday, 21 October 2023, 23:59 GMT
Please try uudeview-20230502-2

/usr/lib/libuu.a should work, no .o needed. At least I was able to build slrn
Comment by loqs (loqs) - Sunday, 22 October 2023, 07:43 GMT
@sergej please consider the following changes:
Dropping configuring and building uulib without -ffat-lto-objects. This then allows dropping !strip from the options array and dropping the manual stripping of the binary.
Dropping staticlibs from the options array as the package does not ship a shared library version of libuu.
Adding -ffat-lto-objects to CFLAGS instead of overwriting them with that value.
Running autoreconf in prepare()

Suggested changes have been applied in the attached diff.
Comment by Sergej Pupykin (sergej) - Sunday, 22 October 2023, 22:52 GMT
added in uudeview-20230502-3

Loading...