[Debian-lego-team] Bug#1015360: Bug#1015360: binutils-h8300-hms: ftbfs with LTO (link time optimization) enabled

Matthew Sheets mesheets at hotmail.com
Sat Nov 1 12:29:03 GMT 2025


> Is it a known problem?

In my testing, I use the following codebase to build the full, combined toolchain:
 * https://github.com/BrickBot/GNU-Legacy-Toolchain

A number of patches have been applied and other update made in order to
continue to be able to build using the latest tools.  GitHub Actions are also
setup to test the compilation process, with both Ubuntu and Windows/Cygwin
runners.  I have a weekly scheduled action setup in an effort to quickly catch
any breaking changes in tooling.  Thus far, it has been building without issue.


Regarding known problems:
As long as GCC hasn't been updated to GCC 15, it seems to build reliably.
However, on other distributions (such as openSUSE) where GCC has been
updated to v15, the build fails.  However, if rolling back the GCC version,
the project builds again without issue.

At least on the surface, I doubt that these are related, but the GCC 15 issue
does appear to be an optimization issue, which I eventually narrowed down
to something within `-O2`.

A summary of my initial findings is here:
* https://alioth-lists.debian.net/pipermail/debian-lego-team/Week-of-Mon-20250714/000659.html

The above is the last email in a chain that spans the July 7, 2025, and July 14, 2025 list archives.
 * https://alioth-lists.debian.net/pipermail/debian-lego-team/

In short—
 * Issues were encountered upon switching to build with GCC 15 in other distros.
 * Values used enum-style basically seem to get trashed.
 * Problem was eventually mitigated by switching `-O2` to `-O`
 * I started to try to narrow down which -O2 optimization(s) might be the culprit,
    but it is a tedious, time-consuming process, and I didn't make much headway.

Again, on the surface, these seem like perhaps different issues, but I thought I
would go ahead and at least raise awareness of a known issue that I have
encountered when using GCC 15.


Thank you,
Matthew



More information about the Debian-lego-team mailing list