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.