https://bugs.winehq.org/show_bug.cgi?id=41712
Bug ID: 41712 Summary: lto build is broken Product: Wine Version: 1.9.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: build-env Assignee: wine-bugs@winehq.org Reporter: hi-angel@yandex.ru Distribution: ---
Compiling WINE with "-flto" in LDFLAGS breaks the build for link-time. The problem boils down to the following minimal example:
$ cat main.c void foo();
int main() { foo(); } $ cat foo.c void foo() { } $ winegcc -c -flto foo.c $ winegcc main.c foo.o /usr/lib/wine/libwinecrt0.a(exe_entry.o): In function `__wine_spec_exe_entry': (.text+0x8d): undefined reference to `ExitProcess' /usr/bin/ld: a.out.so: hidden symbol `ExitProcess' isn't defined /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status winegcc: gcc failed
Simply removing the "-flto" option from the steps fixes the build.
https://bugs.winehq.org/show_bug.cgi?id=41712
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=41712
John E john.ettedgui@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |john.ettedgui@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=41712
Konstantin hi-angel@yandex.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|lto build is broken |WINE lto build fails with | |undefined references
https://bugs.winehq.org/show_bug.cgi?id=41712
--- Comment #1 from Konstantin hi-angel@yandex.ru --- upd: changed description to be more clear.
While on it: the testcase still reproducible with wine 5.8 and winegcc 10.1.0
https://bugs.winehq.org/show_bug.cgi?id=41712
Artem S. Tashkinov aros@gmx.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aros@gmx.com
--- Comment #2 from Artem S. Tashkinov aros@gmx.com --- Loads of other packages don't build with -flto yet:
https://github.com/InBetweenNames/gentooLTO/blob/master/sys-config/ltoize/fi...
https://bugs.winehq.org/show_bug.cgi?id=41712
--- Comment #3 from Artem S. Tashkinov aros@gmx.com --- Related bug 51051.
https://bugs.winehq.org/show_bug.cgi?id=41712
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source
https://bugs.winehq.org/show_bug.cgi?id=41712
--- Comment #4 from Artem S. Tashkinov aros@gmx.com --- (In reply to Artem S. Tashkinov from comment #2)
Loads of other packages don't build with -flto yet:
https://github.com/InBetweenNames/gentooLTO/blob/master/sys-config/ltoize/ files/package.cflags/ltoworkarounds.conf
This has moved to:
https://github.com/InBetweenNames/gentooLTO/tree/master/sys-config/ltoize/fi...
More specifically:
https://github.com/InBetweenNames/gentooLTO/blob/master/sys-config/ltoize/fi...
https://bugs.winehq.org/show_bug.cgi?id=41712
--- Comment #5 from Artem S. Tashkinov aros@gmx.com --- Alexander can make it work at least for non-core libraries.
https://stackoverflow.com/questions/46512325/undefined-references-with-link-...
gcc-ar must be used instead of ar when creating *.a archives.