https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81146
Bug ID: 81146 Summary: Wine 2.10 cannot be compiled with -flto Product: gcc Version: 6.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: t.artem at mailcity dot com Target Milestone: --- I'm trying to compile Wine 2.10 with GCC 6.3.1 for the i686 target and I cannot: ... skipped ... gcc -c -o sfnt2fon.o sfnt2fon.c -I. -I../../include -I/usr/include/freetype2 -I/usr/include/libpng16 \ -D__WINESRC__ -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \ -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \ -fno-omit-frame-pointer -O2 -march=pentium-m -m32 -pipe -flto -D__i386__ gcc -o sfnt2fon sfnt2fon.o ../../libs/port/libwine_port.a -lfreetype -m32 -Wl,-O1 -Wl,--hash-style=gnu -flto /tmp/ccgeEnUu.ltrans0.ltrans.o: In function `main': <artificial>:(.text.startup+0x2c1): undefined reference to `wine_cp_get_table' <artificial>:(.text.startup+0x2e3): undefined reference to `wine_cp_get_table' collect2: error: ld returned 1 exit status Makefile:179: recipe for target 'sfnt2fon' failed make[1]: *** [sfnt2fon] Error 1 make[1]: Leaving directory '/tmp/wine-2.10/tools/sfnt2fon' Makefile:20099: recipe for target 'tools/sfnt2fon' failed make: *** [tools/sfnt2fon] Error 2 These two commands were used before running ./configure && make export CFLAGS="-O2 -march=pentium-m -m32 -pipe -flto" export LDFLAGS="-m32 -Wl,-O1 -Wl,--hash-style=gnu -flto" Of course I might be doing something wrong. In that case I'm sorry. Without -flto everything works fine.