https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63603
--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 21 Oct 2014, burnus at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63603 > > --- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- > (In reply to Tobias Burnus from comment #2) > > COLLECT_GCC_OPTIONS='-v' '-fno-use-linker-plugin' '-fno-lto' > > '-mtune=generic' '-march=x86-64' > > [...]/collect2 [...] > > I haven't shown it, but the collect2 arguments doesn't contain the -fno-lto, > only COLLECT_GCC_OPTIONS has it. > > And in collect2.c's main(), there is a check for > else if (!strncmp (argv[i], "-fno-lto", 8)) > lto_mode = LTO_MODE_NONE; > but that only operates on argv and not on COLLECT_GCC_OPTIONS. That means that /* We pass any -flto flags on to the linker, which is expected to understand them. In practice, this means it had better be collect2. */ /* %{e*} includes -export-dynamic; see comment in common.opt. */ #ifndef LINK_COMMAND_SPEC #define LINK_COMMAND_SPEC "\ %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) " \ LINK_PLUGIN_SPEC \ "%{flto|flto=*:%<fcompare-debug*} \ %{flto} %{flto=*} %l " LINK_PIE_SPEC \ doesn't pass on -fno-lto as expected. Does adding %{fno-lto} after %{flto} work?