diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-10-07 03:01:00 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-10-07 03:03:32 +0200 |
commit | f86cb89cde8192adfdab42ee0b69109ddc12f1bd (patch) | |
tree | 4b9ba30c211e036c82f9ebd097f6b9c6d8bada0f /dev-lang/spidermonkey | |
parent | dev-lang/spidermonkey: enable SIMD in Rust code (diff) | |
download | gentoo-f86cb89cde8192adfdab42ee0b69109ddc12f1bd.tar.gz gentoo-f86cb89cde8192adfdab42ee0b69109ddc12f1bd.tar.bz2 gentoo-f86cb89cde8192adfdab42ee0b69109ddc12f1bd.zip |
dev-lang/spidermonkey: add USE=lto
Forcing LTO via CFLAGS is not enough -- we need to tell build system
that we want to use LTO.
Closes: https://bugs.gentoo.org/746947
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'dev-lang/spidermonkey')
-rw-r--r-- | dev-lang/spidermonkey/metadata.xml | 1 | ||||
-rw-r--r-- | dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/dev-lang/spidermonkey/metadata.xml b/dev-lang/spidermonkey/metadata.xml index fc9478d330b6..c97143567bf6 100644 --- a/dev-lang/spidermonkey/metadata.xml +++ b/dev-lang/spidermonkey/metadata.xml @@ -9,6 +9,7 @@ <flag name="custom-optimization">Build with user-specified compiler optimizations (-Os, -O0, -O1, -O2, -O3) from CFLAGS (unsupported)</flag> <flag name="debug">Enable assertions to allow for easier debugging of programs that link to spidermonkey -- note this will often crash software on regular end-user systems</flag> + <flag name="lto">Enable Link Time Optimization (LTO)</flag> <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg> instead of bundled -- note, only takes effect when icu flag is enabled</flag> </use> </pkgmetadata> diff --git a/dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild b/dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild index a0ec34c118fe..1694f51c1847 100644 --- a/dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild +++ b/dev-lang/spidermonkey/spidermonkey-78.3.1.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python3_{6..9} ) WANT_AUTOCONF="2.1" -inherit autotools check-reqs multiprocessing python-any-r1 toolchain-funcs +inherit autotools check-reqs flag-o-matic multiprocessing python-any-r1 toolchain-funcs MY_PN="mozjs" MY_PV="${PV/_pre*}" # Handle Gentoo pre-releases @@ -53,7 +53,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc64 ~s390 ~x86" SLOT="78" LICENSE="MPL-2.0" -IUSE="cpu_flags_arm_neon debug +jit test" +IUSE="cpu_flags_arm_neon debug +jit lto test" RESTRICT="!test? ( test )" @@ -107,6 +107,8 @@ pkg_setup() { src_prepare() { pushd ../.. &>/dev/null || die + use lto && rm -v "${WORKDIR}"/firefox-patches/*-LTO-Only-enable-LTO-*.patch + eapply "${WORKDIR}"/firefox-patches eapply "${WORKDIR}"/spidermonkey-patches @@ -175,6 +177,14 @@ src_configure() { fi fi + # Tell build system that we want to use LTO + if use lto ; then + myeconfargs+=( --enable-lto ) + fi + + # LTO flag was handled via configure + filter-flags '-flto*' + # Forcing system-icu allows us to skip patching bundled ICU for PPC # and other minor arches ECONF_SOURCE="${S}" \ |