This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Using -flto in CXXFLAGS_FOR_TARGET
- From: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>
- To: "U.Mutlu" <um at mutluit dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 15 Jun 2018 17:57:17 +0800
- Subject: Re: Using -flto in CXXFLAGS_FOR_TARGET
- References: <5B238784.3070309@mutluit.com>
On 2018-06-15 11:31 +0200, U.Mutlu wrote:
> I tried to use -flto in CXXFLAGS_FOR_TARGET. It successfully built the compilers,
> but later when trying to use the compilers, the linker reported an error about
> something missing and aborted the linking.
PR 48200 renders shared libraries with versioned symbols (".symver") unusable if it
was built with -flto. libstdc++ is affected.
> Of course the rationale was to optimize the compiler itself.
>
> So, the question is: does it not make any sense to use -flto for the build itself?
> (Or should one specify -flto in some of the other config variables like
> CXXFLAGS_FOR_BUILD and/or the ...FLAGS vars maybe?)
Use --with-build-config=bootstrap-lto.
"C(XX)FLAGS_FOR_BUILD=-flto" also makes sense (see PR 59893). But you should use
--disable-shared and build the shared libraries w/o LTO, at least for now to
workaround PR 48200. And you should use patch to workaround PR 60160.
--
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University