From ea1b905d267b1cf72e6685015be86ac1d4987a67 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Sun, 16 Sep 2018 06:29:40 -0300 Subject: [PATCH] build-style/meson: enable Link-Time-Optimization by default. --- common/build-style/meson.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh index 6f9256e5881..2a0c6817f18 100644 --- a/common/build-style/meson.sh +++ b/common/build-style/meson.sh @@ -34,7 +34,7 @@ do_configure() { [binaries] c = '${CC}' cpp = '${CXX}' -ar = '${AR}' +ar = '${XBPS_CROSS_TRIPLET}-gcc-ar' nm = '${NM}' ld = '${LD}' strip = '${STRIP}' @@ -76,7 +76,12 @@ EOF unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN fi - ${meson_cmd} --prefix=/usr --buildtype=plain ${configure_args} . ${meson_builddir} + # The binutils ar cannot perform LTO on static libraries so we have to use + # the gcc-ar wrapper that that calls the correct plugin + # https://github.com/mesonbuild/meson/issues/1646 + export AR="gcc-ar" + + ${meson_cmd} --prefix=/usr -Db_lto=true --buildtype=plain ${configure_args} . ${meson_builddir} } do_build() {