Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW-GCC internal compiler error on Windows x86_32 with LTO enabled #92585

Closed
akien-mga opened this issue May 31, 2024 · 4 comments · Fixed by #92753
Closed

MinGW-GCC internal compiler error on Windows x86_32 with LTO enabled #92585

akien-mga opened this issue May 31, 2024 · 4 comments · Fixed by #92753

Comments

@akien-mga
Copy link
Member

Tested versions

System information

Fedora 39, MinGW-GCC 13.2.1

Issue description

I don't know why yet, but MinGW-GCC LTO builds failed for Windows x86_32 shortly after 4.3-dev6. I bisected it to #89114.

When building with scons platform=windows arch=x86_32 target=editor production=yes, I ran into one of several possible linking issues:

lto1: error: two or more sections for .gnu.lto__ZZL33_register_variant_builtin_methodsvEN44Method_PackedByteArray_get_string_from_wchar17get_argument_typeEi.lto_priv.0.24543200.12b4f1e18c89c353
(null):0: confused by earlier errors, bailing out
lto1: error: two or more sections for .gnu.lto__ZZL33_register_variant_builtin_methodsvEN27Method_PackedByteArray_sort17get_argument_typeEi.lto_priv.0.24488113.7355bbf912c4778c
(null):0: confused by earlier errors, bailing out

Or outright:

lto1: internal compiler error: cannot read 'LTO_section_decls' from /tmp/cc5pGqEL.ltrans116.o

Somehow #89114 is triggering a bug in GCC LTO.

Steps to reproduce

  • Setup MinGW-GCC (used Fedora 39 packages, GCC version 13.2.1 and MinGW headers 11.0.0)
  • Compiling with scons platform=windows arch=x86_32 target=editor production=yes

Minimal reproduction project (MRP)

n/a

@akien-mga
Copy link
Member Author

I found this while building 4.3-beta1 and couldn't find a quick fix, so for that build I'm going to release Windows 32-bit builds without LTO. But we should find a workaround for beta2 ideally.

@akien-mga
Copy link
Member Author

akien-mga commented Jun 19, 2024

I still have this error in the current master branch in a fedora:39 container:

lto1: error: two or more sections for .gnu.lto__ZZL39_register_variant_builtin_methods_arrayvEN16Method_Array_map17get_argument_typeEi.lto_priv.0.24592882.34357455644a6950
(null):0: confused by earlier errors, bailing out

On the other hand it's not reproducible in a fedora:40 container, so it's related to the mingw/gcc/binutils versions.

@akien-mga akien-mga reopened this Jun 19, 2024
@akien-mga
Copy link
Member Author

So I didn't do a full investigation but the quick conclusion is that the MinGW/GCC/binutils combo in Fedora 39 has a bug. The easy solution is to update our containers to Fedora 40, which has newer versions of those packages and fixes that bug.

So I'm doing this for 4.3-beta2.

@limbonaut
Copy link
Contributor

I encountered the same issue using Ubuntu 24.04 GitHub runner and 4.3-stable. Just FYI, no need to reopen.

lto1: error: two or more sections for .gnu.lto__ZZL39_register_variant_builtin_methods_arrayvEN27Method_PackedByteArray_fill17get_argument_typeEi.lto_priv.0.34929690.16dd58478e33f9a6
(null):0: confused by earlier errors, bailing out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Immediate Blocker
Development

Successfully merging a pull request may close this issue.

4 participants