This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Enabling LTO for target libraries (e.g., libgo, libstdc++)
- From: Allan Sandfeld Jensen <linux at carewolf dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Nikhil Benesch <nikhil dot benesch at gmail dot com>
- Date: Fri, 25 Jan 2019 19:29:58 +0100
- Subject: Re: Enabling LTO for target libraries (e.g., libgo, libstdc++)
- References: <15AB63CE-F825-4135-A777-5066303606A2@gmail.com>
On Freitag, 25. Januar 2019 07:22:36 CET Nikhil Benesch wrote:
> Does anyone have advice to offer? Has anyone tried convincing the build
> system to compile some of the other target libraries (like libstdc++ or
> libgfortran) with -flto?
>
Make sure the static versions of the libraries are partially linked before
being archived so they do not have LTO code in the final libraries.
gcc -r <objectfiles> -o libname.o
ar x libname.a libname.o
Never done it with gcc libraries though.
'Allan