[pacman-dev] [PATCH] Add link time optimization support to makepkg
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
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
--- 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
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
--- 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.
doc/PKGBUILD.5.asciidoc | 4 +++ doc/makepkg.conf.5.asciidoc | 4 +++ etc/makepkg.conf.in | 5 ++-- scripts/libmakepkg/buildenv/lto.sh.in | 37 +++++++++++++++++++++++++++
Self-review: This file needs added to the relevant meson.build. This has been done and is on my patchqueue branch. Allan
4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 scripts/libmakepkg/buildenv/lto.sh.in
participants (1)
-
Allan McRae