http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56088
Bug #: 56088 Summary: LTO error: error: inlining failed in call to always_inline ‘vswprintf’: recursive inlining Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: vhais...@gmail.com Created attachment 29258 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29258 bug sources I am seeing the following compilation/linking error that I am not seeing with non-LTO builds: --8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8< In file included from :256:0: /usr/include/x86_64-linux-gnu/bits/wchar2.h: In function ‘_ZN9__gnu_cxx12__to_xstringISbIwSt11char_traitsIwESaIwEEwEET_PFiPT0_mPKS6_P13__va_list_tagEmS9_z.constprop.0’: /usr/include/x86_64-linux-gnu/bits/wchar2.h:316:28: error: inlining failed in call to always_inline ‘vswprintf’: recursive inlining __NTH (vswprintf (wchar_t *__restrict __s, size_t __n, ^ In file included from /home/wilx/gcc48/include/c++/4.8.0/bits/stl_algobase.h:3320:0, from :1177: /usr/include/x86_64-linux-gnu/bits/wchar2.h:322:50: error: called from here return __vswprintf_alias (__s, __n, __fmt, __ap); ^ lto-wrapper: g++-4.8 returned 1 exit status /usr/bin/ld.gold: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status --8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8< I am attaching the single .o file that reproduces the problem for me. Here is a command line that causes it for me: g++-4.8 -v -fPIC -DPIC -r -nostdlib ./timehelper.o -march=native -O3 -flto -flto-partition=none -fuse-linker-plugin -o out.so