[pacman-dev] [PATCH] Add link time optimization support to makepkg

Allan McRae allan at archlinux.org
Mon Mar 1 04:24:45 UTC 2021


On 1/3/21 2:19 pm, Allan McRae wrote:
> Add the 'lto' option to enable building with link time optimization
> by adding '-flto' to both CFLAGS and CXXFLAGS.  The 'lto' option can
> be specificed both in the PKGBUILD or by setting the default in
> makepkg.conf.
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
> 
> TODO:
>  - strip LTO symbols from distributed .a/.o files.
>    e.g. https://bugzilla.redhat.com/attachment.cgi?id=1650804&action=diff
> 
>  - provide helper script to adjust old autoconf files for LTO support(?)
>    e.g. https://bugzilla.redhat.com/attachment.cgi?id=1650843&action=diff
>    Not sure this should be part of makepkg or distribution tools.

In Arch, this script could be distributed as a makepkg template.  As
makepkg-template places a copy of the templated code in the PKGBUILD,
users would not need devtools installed to use the PKGBUILD.

I'm thinking this is the best approach.  Opinions?

A


More information about the pacman-dev mailing list